2015-07-05, 12:13 AM
I found a problem with the plugin today. I have already reported it in another thread, but it is good to mention it here as this is sort of the official thread for the plugin.
In MyBB 1.8, there is a new capability that allows moderators to move posts from one thread to another. This functionality seems to be broken by the SEO plugin.
I did a bit of debugging, the problem is caused by the way moderation.php:2433 ("do_multimoveposts") tries to resolve "realurl". I don't know why the code to resolve actual thread URLs is repeated in various places inside "moderation.php". It could be refactored in a function and that function could possibly take care of SEO URLs as well.
If someone has already found a solution, please update the thread.
I have been able to find a hacky workaround to make it work. Diff is below.
However, a proper fix requires updates to both MyBB and the plugin. The problem is that "do_multimoveposts" in "moderation.php" does not have a hook for plugins. It needs a plugin hook and then the SEO plugin should register a callback at this hook. Until this is fixed, those who want to use the plugin can use the workaround below. Basically you will need to add
$plugins->run_hooks("moderation_do_merge");
after "verify_post_check..." at line 2430 of moderation.php.
In MyBB 1.8, there is a new capability that allows moderators to move posts from one thread to another. This functionality seems to be broken by the SEO plugin.
I did a bit of debugging, the problem is caused by the way moderation.php:2433 ("do_multimoveposts") tries to resolve "realurl". I don't know why the code to resolve actual thread URLs is repeated in various places inside "moderation.php". It could be refactored in a function and that function could possibly take care of SEO URLs as well.
If someone has already found a solution, please update the thread.
I have been able to find a hacky workaround to make it work. Diff is below.
However, a proper fix requires updates to both MyBB and the plugin. The problem is that "do_multimoveposts" in "moderation.php" does not have a hook for plugins. It needs a plugin hook and then the SEO plugin should register a callback at this hook. Until this is fixed, those who want to use the plugin can use the workaround below. Basically you will need to add
$plugins->run_hooks("moderation_do_merge");
after "verify_post_check..." at line 2430 of moderation.php.
--- ../mybb_1805/Upload/moderation.php 2015-05-25 11:37:18.000000000 -0700
+++ moderation.php 2015-07-04 19:33:26.000000000 -0700
@@ -2427,6 +2427,8 @@
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));
+ $plugins->run_hooks("moderation_do_merge");
+
// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));
$mybb->input['threadurl'] = $realurl[0];