Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Attachments 2.1 and empty discussion submission

edited August 2008 in Vanilla 2.0 - 2.8
Note sure if anyone has seen this before or not....

If you try to start a new discussion in Vanilla but you leave the discussion topic or comments field blank, Vanilla will show you some warnings about this and tell you to please fill in those fields before submitting. Very nice.

However if you enable the Attachments 2.1 extension and then try to start a discussion with empty discussion and comments you get 8 lines of code error instead.

Ex: Notice: Trying to get property of non-object in /home/[path to vanilla]/Vanilla/Vanilla.Control.CommentGrid.php on line 71
Notice: Trying to get property of non-object in /home/[path to vanilla]/comments.php on line 55
The requested discussion could not be found.

Disable Attachments 2.1 and the problem goes away.

Has anyone else seen this or can anyon else verify it?



  • Heh, and here I was thinking it was just Vanilla that was causing this problem! Naughty me. I shall test without Attachments enabled and come back to you...
  • I can confirm this bug.

    With Attachments 2.1 disabled


    With Attachments 2.1 enabled

  • The requested discussion could not be found
  • Excuses by the previous message, were an error. It wanted to ask if were some solution to this bug.
  • Any solution for this bug ? Maybe prev. version of attachements plugin was better ? If someone have Attachements plugin V2.0 or lower, please attach it here.
  • edited October 2007
    Supposedly, there's a fix. But it gives me an error when I try to implement it.

    Anyone know what the problem is?

    If so, it's probably best to contribute the solution to the official Attachments 2.1 discussion thread, here.
  • hi! I have a solution to this:

    change this code in attachments/default.php:

    // Save Attachments function DiscussionForm_SaveDiscussionAttachments(&$DiscussionForm) { $Discussion = &$DiscussionForm->DelegateParameters['ResultDiscussion']; $AttachmentManager = &$DiscussionForm->DelegateParameters['AttachmentManager']; $AttachmentManager->DiscussionID = $Discussion->DiscussionID; $AttachmentManager->Comment = &$Discussion->Comment; $AttachmentManager->SaveAttachments(); }

    // Save Attachments function DiscussionForm_SaveDiscussionAttachments(&$DiscussionForm) { $Discussion = &$DiscussionForm->DelegateParameters['ResultDiscussion']; $AttachmentManager = &$DiscussionForm->DelegateParameters['AttachmentManager']; // dont save if don't have a DiscussionID if (!empty($Discussion->DiscussionID) && $Discussion->DiscussionID != '') { $AttachmentManager->DiscussionID = $Discussion->DiscussionID; $AttachmentManager->Comment = &$Discussion->Comment; $AttachmentManager->SaveAttachments(); }}
    I'm not a php coder but worked for me
    sorry for my english.
This discussion has been closed.