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 PHP error with Vanilla 2.0.18.14?
khalwat
New
I downloaded and enabled the latest NillaBlog, after clicking on "Enable" it generated a PHP error. Below is the gory details.
So obviously I can see the problem, the variable $Wheres is set to the string "all" and array_key_exists() expects that it's going to be an array. Is this just an error in the code? Did this plugin ever work on 2.0.18.x?
Environment: Additional information for support personnel: Application: Vanilla Application Version: 2.0.18.14 PHP Version: 5.3.3 Operating System: Linux Server Software: Apache/2.2.15 (CentOS) User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25 Request Uri: /forums/dashboard/settings/plugins Controller: PHP Method: array_key_exists Error: array_key_exists() expects parameter 2 to be array, string given The error occurred on or near: /var/www/clp/forums/plugins/NillaBlog/class.nillablog.plugin.php 165: * @param $Sender 166: */ 167: public function DiscussionModel_BeforeGet_Handler($Sender) { 168: $Wheres = $Sender->EventArguments["Wheres"]; 169: if (!array_key_exists("d.CategoryID", $Wheres) || !in_array($Wheres["d.CategoryID"], C("Plugins.NillaBlog.CategoryIDs"))) 170: return; 171: 172: $Sender->EventArguments["SortField"] = "d.DateInserted"; 173: $Sender->EventArguments["SortDirection"] = "desc"; Backtrace: /var/www/clp/forums/plugins/NillaBlog/class.nillablog.plugin.phpPHP::Gdn_ErrorHandler(); [/var/www/clp/forums/plugins/NillaBlog/class.nillablog.plugin.php:169] PHP::array_key_exists(); [/var/www/clp/forums/library/core/class.pluginmanager.php:648] NillaBlog->DiscussionModel_BeforeGet_Handler(); [/var/www/clp/forums/library/core/class.pluginmanager.php:590] Gdn_PluginManager->CallEventHandler(); [/var/www/clp/forums/library/core/class.pluggable.php:127] Gdn_PluginManager->CallEventHandlers(); [/var/www/clp/forums/applications/vanilla/models/class.discussionmodel.php:164] Gdn_Pluggable->FireEvent(); [/var/www/clp/forums/plugins/LatestPostList/modules/class.latestpostlistmodule.php:27] DiscussionModel->Get(); [/var/www/clp/forums/plugins/LatestPostList/class.latestpostlist.plugin.php:45] LatestPostListModule->SetData(); [/var/www/clp/forums/plugins/LatestPostList/class.latestpostlist.plugin.php:100] LatestPostList->LoadLPLModule(); [/var/www/clp/forums/library/core/class.pluginmanager.php:648] LatestPostList->Base_Render_Before(); [/var/www/clp/forums/library/core/class.pluginmanager.php:594] Gdn_PluginManager->CallEventHandler(); [/var/www/clp/forums/library/core/class.pluggable.php:179] Gdn_PluginManager->CallEventHandlers(); [/var/www/clp/forums/applications/dashboard/controllers/class.settingscontroller.php:666] Gdn_Pluggable->__call(); [/var/www/clp/forums/applications/dashboard/controllers/class.settingscontroller.php:666] SettingsController->Render(); [/var/www/clp/forums/applications/dashboard/controllers/class.settingscontroller.php:666] SettingsController->Plugins(); [/var/www/clp/forums/library/core/class.dispatcher.php:322] PHP::call_user_func_array(); [/var/www/clp/forums/index.php:53] Gdn_Dispatcher->Dispatch(); Variables in scope: Variables in local scope: [Sender] array ( 'Watching' => false, 'Data' => NULL, 'Database' => 'SECURITY', 'DateInserted' => 'DateInserted', 'DateUpdated' => 'DateUpdated', 'InsertUserID' => 'InsertUserID', 'Name' => 'Discussion', 'PrimaryKey' => 'id', 'Schema' => NULL, 'SQL' => array ( 'CaptureModifications' => false, 'ClassName' => 'Gdn_MySQLDriver', 'Database' => 'SECURITY', '_Order' => false, ), 'UpdateUserID' => 'UpdateUserID', 'Validation' => array ( ), 'EventArguments' => array ( 'SortField' => 'd.DateLastComment', 'SortDirection' => 'desc', 'Wheres' => 'all', ), 'Returns' => array ( 'discussionmodel_beforeget_handler' => array ( ), ), 'HandlerType' => 'NORMAL', ) [Wheres] 'all'
0
Comments
So I added this at line 170 of class.nillablog.plugin.php:
/* -- Make sure $Wheres is an array -- aaw 11/20/2014 */
...and it seems to function properly.
I would certainly upgrade to one of the latest versions of vanilla.
as of today....
vanilla 2.0.18.14 or better yet 2.1.5
if you do decide to fix the security problems with the version of vanilla you have and decide to upgrade
please read the readme, and the release notes and see what plugins and themes are compatible with vanilla 2.1.x
http://vanillaforums.org/discussion/26685/vanilla-2-1-stable-released/p1
https://github.com/vanilla/vanilla/blob/2.1/README.md
you might look here as well: http://vanillaforums.org/discussion/comment/199091/#Comment_199091
you may need to check here - to see if fellow users are adding to this spreadsheet, it takes a community and members of the community might want to help:
http://vanillaforums.org/discussion/26703/plugins-themes-that-work-and-dont-work-in-vanilla-2-1/p1
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Peregrine, I am using the latest version -> Application Version: 2.0.18.14 as per the post.
no problem.
but I focused on the title of post say "NillaBlog PHP error with Vanilla 2.0.18.4?"
.
but now I see your error message shows 2.0.8.14 as I look closer in discussion body and error message.
still think when you get a chance 2.1.5 is the better version. although some plugins and themes may be incompatible, you will be on track for security upgrades (and 2.0.18.x will have no more security upgrades after the close of 2014).
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@khalwat Just for your info, NillaBlog works on 2.1 but you will have to readjust the styling.
You could also try (and help testing) the Vanilla Articles App, which will hopefully leave alpha stage soon:
https://github.com/shadowdare/Vanilla-App-Articles
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Glad to hear it's working in 2.1.
I unfortunately have not had time to maintain the plugin. I will accept pull requests though for those interested in helping maintain it.
There was an error rendering this rich post.