HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Split/Merge FE 1.01 on Vanilla 2.1b1: Move Comment not working

I just discovered a problem with Split/Merge FE on 2.1b1. When I select a comment, and try to move it, I get just a small empty overlay box at the top of the comment besides the tick box:

image

I've looked through class.splitmergefe.plugin.php, but still being a Vanilla n00b I have no idea what could be wrong.

Comments

  • see
    http://vanillaforums.org/discussion/comment/183746/#Comment_183746

    if I could split/merge/move the comments here it I would.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited May 2013

    problem I believe is in line 131 or vicinity

    call to a member function Put() on a non-object.

    in class.splitmergefe.plugin.php

    if ($Sender->Form->ErrorCount() == 0) {
    $ResultDiscussionID = $ResultDiscussion->DiscussionID;
    $CommentModel = new CommentModel();
    $CommentModel->SQL
    ->Update($CommentModel->Name)
    ->Set('DiscussionID', $ResultDiscussionID)
    ->WhereIn('CommentID', $DiscussionCommentIDs)
    ->Put();
    

    as an experiment I did this

    if ($Sender->Form->ErrorCount() == 0) {
    $ResultDiscussionID = $ResultDiscussion->DiscussionID;
    // hardcoded an existing comment
    $DiscussionCommentIDs ="64";
    $CommentModel = new CommentModel();
    $CommentModel->SQL
    ->Update($CommentModel->Name)
    ->Set('DiscussionID', $ResultDiscussionID)

                   ->Where('CommentID', $DiscussionCommentIDs)
                    ->Put();
    

    and this

    $DiscussionCommentIDs =array("63","62");
                    $CommentModel = new CommentModel();
                    $CommentModel->SQL
                        ->Update($CommentModel->Name)
                        ->Set('DiscussionID', $ResultDiscussionID)
                        ->Where('CommentID', $DiscussionCommentIDs)
                        ->Put();
    

    and both moved the comments mentioned.

    @whu606
    so $DiscussionCommentIDs needs to populated correctly

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    Oooh, @peregrine

    You absolute star!

    It's a bit past beer o'clock here, so will have a fiddle with that tomorrow.

    Thank you so much for your trouble.

  • That will be interesting to see how this problem can be solved (I'm learning so much by just watching what the pros are able to do). :)

  • peregrineperegrine MVP
    edited May 2013

    @whu606 said:
    Oooh, peregrine

    You absolute star!

    It's a bit past beer o'clock here, so will have a fiddle with that tomorrow.

    Thank you so much for your trouble.

    if you want another clue - I can get you closer to the problem (provided my thought is not a red herring).

    Concentrate on populating $DiscussionCommentIDs nearer the top of the program code.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited May 2013

    if you want to test this. I think it will fix it. But make sure you back up your database.

    It appears to work for me.

    public function ModerationController_MoveComments_Create($Sender, $RequestArgs = NULL) {
            $DiscussionID = $RequestArgs[0];
    

    to

    public function ModerationController_MoveComments_Create($Sender, $RequestArgs = NULL) {
            $DiscussionID = $RequestArgs[0];
                if (!is_array($RequestArgs)) {
              $DiscussionID = $RequestArgs;
              }
    

    strange that RequestArgs is no longer an array in 2.1 but a string ! At least in this case.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • probably ever cleaner - just make this one change

        public function ModerationController_MoveComments_Create($Sender, $RequestArgs = NULL) {
        $DiscussionID = $RequestArgs[0];
    
    to
      public function ModerationController_MoveComments_Create($Sender, $RequestArgs = NULL) {
        $DiscussionID = $Sender->RequestArgs[0];
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @peregrine

    How can I thank you?

    Oooh, I know, I'll send you a donation - only I can't find where to send it.

  • I can confirm it's working. You guys are truly amazing! :)

    Can someone tell me, why MoveComment has "Discussion Topic" and "Discussion ID" entry fields? "Discussion ID" is automatically filled once a topic has been chosen.

  • peregrineperegrine MVP
    edited May 2013

    @whu606 said:
    peregrine

    How can I thank you?

    Oooh, I know, I'll send you a donation - only I can't find where to send it.

    cool. I'll pm you.


    @MasterOne

    Can someone tell me, why MoveComment has "Discussion Topic" and "Discussion ID" entry fields? "Discussion ID" is automatically filled once a topic has been chosen.

    you can just enter discussion id if you want. The discussion name just locates the the discussion id, the id is what it cares about in the scheme of things. It's called friendlier user interface.

    you still haven't learned how to click insightful, eh!

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @whu606 said:
    Oooh, peregrine

    You absolute star!

    It's a bit past beer o'clock here, so will have a fiddle with that tomorrow.

    Thank you so much for your trouble.

    @peregrine is not star. He is super star! =)

  • Thank you @peregrine !!!

Sign In or Register to comment.