Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

NillaBlog not working

Hello every time I try clicking a Blog Category and click save I get this error:
Plugins.NillaBlog.CategoryIDs is not a valid string.

«1

Comments

  • hgtonighthgtonight ∞ · New Moderator

    bump for @ddumont

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight said:
    bump for ddumont

    Was this your plugin?

  • Hrmmm

    There was an error rendering this rich post.

  • I may need to ask for help... It's been so long since I've been looking at this... I've forgotten everything.
    @Linc Any chance you could help me out when/if you get a chance?
    Did the way to save/read array preferences change?

    There was an error rendering this rich post.

  • shumooshumoo New
    edited November 2015

    The config.php file doesn't get updated properly...if you edit it and put in this line it will work:
    $Configuration['Plugins']['NillaBlog']['CategoryIDs'] = array('13');

    The array size will vary based on your need but doing this will get you going and you can edit it from the admin screen.

  • @shumoo Which line?
    Not sure I understand. What do you mean the config doesn't get updated properly?

    There was an error rendering this rich post.

  • I mean that the addon does not properly update the config.php when you click save and it would normally write to the config.php file for the first time. You must overwrite the entry it places there for the 'CategoryIDs' reference. After you have done so, you can resuming using the UI instead of editing config.php manually.

  • Hmmm... sounds like something I'm doing wrong in the plugin then. I'd rather fix that than make people have to edit the config manually.

    There was an error rendering this rich post.

  • For whatever reason I didn't realize you were the author...I read your question like you were the person trying to get the plugin to work.

    Yes, I believe class file has this line in it:
    $ConfigurationModel->SetField(array("Plugins.NillaBlog.CategoryIDs"));

    That's what I suspect is not evaluating properly because of the "array(" portion. I think if that was removed and the value was set later in execution it may be fine. I'm still pretty new to all this php business so I could be wrong - but this is more or less the right track to begin looking.

  • The report here says the error is on save though, not on the plugin create. Are you saying that seeding it with an empty array is freaking out the control later on?

    There was an error rendering this rich post.

  • @hgtonight lol it looks like you lifted my entire plugin for yours. Did you manage to solve this issue already? :)

    There was an error rendering this rich post.

  • or... that might be why you're here :) lol

    There was an error rendering this rich post.

  • I just deployed it on a fresh copy of 2.2rc1. It does not create the entries under //Plugins once enabled.

    vrijvlinder
  • The array syntax should be ok if I'm reading this correctly:
    https://github.com/vanilla/vanilla/blob/b94c27ed88badd5320aec68a1f648d1ef89e5790/library/core/class.configurationmodel.php#L60

    I mean I could have simplified this all to be within that array I think... But it was such a long time ago that I wrote this I barely remember php ;)

    There was an error rendering this rich post.

    R_J
  • I wonder if it's because it needs a default value later on... perhaps something like
    $ConfigurationModel->SetField(array("Plugins.NillaBlog.CategoryIDs" => array()));

    There was an error rendering this rich post.

  • @shumoo would you be able to test that on your fresh instance?
    Also do you have a quick way of spinning up vanilla instances you could let me know about?

    There was an error rendering this rich post.

  • `

    // EnabledPlugins
    $Configuration['EnabledPlugins']['GettingStarted'] = 'GettingStarted';
    $Configuration['EnabledPlugins']['HtmLawed'] = 'HtmLawed';
    $Configuration['EnabledPlugins']['VanillaStats'] = true;
    $Configuration['EnabledPlugins']['NillaBlog'] = true;

    ...
    // Plugins
    $Configuration['Plugins']['GettingStarted']['Dashboard'] = '1';
    $Configuration['Plugins']['GettingStarted']['Plugins'] = '1';
    $Configuration['Plugins']['GettingStarted']['Discussion'] = '1';

    // Routes
    $Configuration['Routes']['DefaultController'] = 'discussions';
    `

    vrijvlinderunixhero
  • @ddumont, yes, changing it to $ConfigurationModel->SetField(array("Plugins.NillaBlog.CategoryIDs" => array())); corrects the problem.

    ddumontvrijvlinderunixhero
  • woot!

    There was an error rendering this rich post.

  • ok. Updated the source and pushed a new release. Thanks for the help!

    There was an error rendering this rich post.

    vrijvlinderR_JunixheroBleistivt
Sign In or Register to comment.