Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 14

6apxatHotBlackestlf349141590tc74422 +8 guests

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!

Comments

  • Posts: 2,610
    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...
  • Posts: 2,610
    I can confirm this bug.

    With Attachments 2.1 disabled

    image

    With Attachments 2.1 enabled

    image
  • Posts: 5
    The requested discussion could not be found
  • Posts: 5
    Excuses by the previous message, were an error. It wanted to ask if were some solution to this bug.
    thanks
  • 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.
  • Posts: 421
    Supposedly, there's a fix. But it gives me an error when I try to implement it.

    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.
  • Posts: 2
    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();
    }

    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.
This discussion has been closed.