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.

I get this php error/notice when editing drafts

xm1xm1 New
edited October 2015 in Vanilla 2.0 - 2.8

I enabled debugging by adding $Configuration['Debug'] = TRUE; in config.php
When I open a drafted discussion to edit I get the following php notice in the edit page.
Notice: Trying to get property of non-object in C:\xampp\htdocs\forum\applications\vanilla\controllers\class.postcontroller.php on line 109
when I submit the discussion I get the following in a popup/modal:

  "Code": 2,
  "Exception": "array_merge(): Argument #1 is not an array",
  "Class": "Gdn_ErrorException",
  "Trace": [
      "Need to re-index theme cache",
      "Need to re-index plugin cache",
  "StackTrace": "#0 [internal function]: Gdn_ErrorHandler(2, 'array_merge(): ...', 'C:\\\\xampp\\\\htdocs...', 1524, Array)\n#1 C:\\xampp\\htdocs\\forum\\applications\\vanilla\\models\\class.discussionmodel.php(1524): array_merge('this just to ma...', 'This is a conte...')\n#2 C:\\xampp\\htdocs\\forum\\applications\\vanilla\\controllers\\class.postcontroller.php(202): DiscussionModel->Save(Array, Object(CommentModel))\n#3 C:\\xampp\\htdocs\\forum\\applications\\vanilla\\controllers\\class.postcontroller.php(314): PostController->Discussion(30)\n#4 [internal function]: PostController->EditDiscussion('0', '250')\n#5 C:\\xampp\\htdocs\\forum\\library\\core\\class.dispatcher.php(350): call_user_func_array(Array, Array)\n#6 C:\\xampp\\htdocs\\forum\\index.php(46): Gdn_Dispatcher->Dispatch()\n#7 {main}",
  "Data": {
    "Title": "New Discussion"

The discussion actually get published.

I have looked into the class.postcontroller.php file and I saw this: $this->CategoryID = $Category->CategoryID;
I modified it like this: $this->CategoryID = (!empty($Category->CategoryID)) ? $CategoryID->CategoryID : 0;
Well, the notice disappears.
But I still get that scary error in a popup when I submit.

If I disable debugging everything works fine.

So can someone explain what is going on?
Is this a bug a from vanilla?
Is it from the 2.1.12 update that I just installed? I've not tried enabling debugging in previous versions


Sign In or Register to comment.