Moodle
  1. Moodle
  2. MDL-6342

cannot move forum post to other forum when the subject includes an apostrophe

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.3
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE

      Description

      I think the subject line reflects what is happening. I had a forum post with the following subject line:

      Race on to save Egypt's ancient treasures

      I tried moving this post from the forum it was originally in to another forum. It said the post was moved. In fact, the bread crumb trail showed the new forum even above the original post. But then when I went to the main forum pages, it was still in its original forum. I tried this several times, and it remained where it had been originally. Noticing there was an apostrophe in the subject line, I took a wild stab at it and reworded the subject line without the apostrophe. I was then able to move the post.

        Gliffy Diagrams

        1. discuss.php.diff
          0.9 kB
          Richard Mansfield

          Issue Links

            Activity

            Hide
            N Hansen added a comment -

            See also the following bugs as they might be caused by the same issue and/or were resolved as this one could be:

            bug 2776
            bug 4762
            bug 1611
            bug 4136

            There may be more, but that should be enough to get started.

            Show
            N Hansen added a comment - See also the following bugs as they might be caused by the same issue and/or were resolved as this one could be: bug 2776 bug 4762 bug 1611 bug 4136 There may be more, but that should be enough to get started.
            Hide
            Richard Mansfield added a comment -

            Also, when a discussion with an apostrophe in the subject is moved to another forum, the attachments on all the posts in that discussion get put into the new forum's data directory correctly, so even though the discussion is still visible under the original forum, the attachments disappear.

            Show
            Richard Mansfield added a comment - Also, when a discussion with an apostrophe in the subject is moved to another forum, the attachments on all the posts in that discussion get put into the new forum's data directory correctly, so even though the discussion is still visible under the original forum, the attachments disappear.
            Hide
            Richard Mansfield added a comment -

            This fixed the problem for me:

            — discuss.php~ 2006-06-27 14:08:30.000000000 +1200
            +++ discuss.php 2006-09-10 14:49:44.000000000 +1200
            @@ -62,6 +62,7 @@
            notify('Bad forum ID stored in this discussion');
            }
            $discussion->forum = $forum->id;
            + $discussion->name = addslashes($discussion->name);
            $discussion->timemodified = time();

            if (update_record('forum_discussions', $discussion))

            { @@ -77,6 +78,7 @@ 'destination forum(s) - check your file permissionsforums'); }

            }
            + $discussion->name = stripslashes($discussion->name);

            if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
            add_to_log($course->id, "forum", "move discussion", "discuss.php?d=$discussion->id", "$discussion->id",

            Show
            Richard Mansfield added a comment - This fixed the problem for me: — discuss.php~ 2006-06-27 14:08:30.000000000 +1200 +++ discuss.php 2006-09-10 14:49:44.000000000 +1200 @@ -62,6 +62,7 @@ notify('Bad forum ID stored in this discussion'); } $discussion->forum = $forum->id; + $discussion->name = addslashes($discussion->name); $discussion->timemodified = time(); if (update_record('forum_discussions', $discussion)) { @@ -77,6 +78,7 @@ 'destination forum(s) - check your file permissionsforums'); } } + $discussion->name = stripslashes($discussion->name); if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) { add_to_log($course->id, "forum", "move discussion", "discuss.php?d=$discussion->id", "$discussion->id",
            Hide
            Richard Mansfield added a comment -

            Whoops, some spaces got stripped out of that comment. I've attached the file instead.

            Show
            Richard Mansfield added a comment - Whoops, some spaces got stripped out of that comment. I've attached the file instead.
            Hide
            Martín Langhoff added a comment -

            Fixed by merging into 1.6 the changes MD applied to HEAD. These were better and more consistent than Richard Mansfield proposed patch.

            Please test and close.

            In the fixing of this bug I found head had a regression for #5131 which I reverted as well.

            Show
            Martín Langhoff added a comment - Fixed by merging into 1.6 the changes MD applied to HEAD. These were better and more consistent than Richard Mansfield proposed patch. Please test and close. In the fixing of this bug I found head had a regression for #5131 which I reverted as well.
            Hide
            Stephen Bourget added a comment -

            Tested using the Nightly CVS build of Moodle 1.6 Stable.

            Marking the issue as closed

            -Steve

            Show
            Stephen Bourget added a comment - Tested using the Nightly CVS build of Moodle 1.6 Stable. Marking the issue as closed -Steve

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: