Skip to content
Browse files

Fix bug 6342 - cannot move forum post to other forum when the subject…

… includes an apostrophe

This is actually a merge of a similar fix from HEAD
  • Loading branch information...
1 parent f6965dc commit 4f70e2756a0578312e24beecfd1e3421b2b26dab martinlanghoff committed Sep 17, 2006
Showing with 12 additions and 20 deletions.
  1. +12 −20 mod/forum/discuss.php
View
32 mod/forum/discuss.php
@@ -57,27 +57,19 @@
if (!forum_move_attachments($discussion, $move)) {
notify("Errors occurred while moving attachment directories - check your file permissions");
}
-
- if (!$fromforum = get_record("forum", "id", $discussion->forum)) {
- notify('Bad forum ID stored in this discussion');
- }
+ set_field("forum_discussions", "forum", $forum->id, "id", $discussion->id);
$discussion->forum = $forum->id;
- // Had to comment out the following line because the timemodified field is used to sort the list
- // of discussions and also to provide the "Last post" date. It should really be renamed to timelastpost.
- // $discussion->timemodified = time();
-
- if (update_record('forum_discussions', $discussion)) {
- // Update RSS feeds for both from and to forums.
- require_once('rsslib.php');
- require_once($CFG->libdir.'/rsslib.php');
-
- // Delete the RSS files for the 2 forums because we want to force
- // the regeneration of the feeds since the discussions have been
- // moved.
- if (!forum_rss_delete_file($forum) || !forum_rss_delete_file($fromforum)) {
- notify('Could not purge the cached RSS feeds for the source and/or'.
- 'destination forum(s) - check your file permissionsforums');
- }
+
+ // Update RSS feeds for both from and to forums.
+ require_once('rsslib.php');
+ require_once($CFG->libdir.'/rsslib.php');
+
+ // Delete the RSS files for the 2 forums because we want to force
+ // the regeneration of the feeds since the discussions have been
+ // moved.
+ if (!forum_rss_delete_file($forum) || !forum_rss_delete_file($fromforum)) {
+ notify('Could not purge the cached RSS feeds for the source and/or'.
+ 'destination forum(s) - check your file permissionsforums');
}
if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {

0 comments on commit 4f70e27

Please sign in to comment.
Something went wrong with that request. Please try again.