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.
Attachments 2.1 and empty discussion submission
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?
Thanks!
0
This discussion has been closed.
Comments
With Attachments 2.1 disabled
With Attachments 2.1 enabled
thanks
http://lussumo.com/community/?CommentID=74878
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.
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(); }
to
// 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.