Closed boonebgorges closed 2 days ago
Just commenting that this bug caused me to uninstall this plugin from my multisite until it is fixed.
It caused blogs on a multisite who were running the same theme to pull the site name and tagline of another blog on the network, it broke gravity forms because it was searching for forms from a different site, and broke several themes.
We have uninstalled until an update fixes the issue.
Same for me:
After disabling the plugin, everything returns to normal. Waiting for a fix.
multisite-enhancements.zip Package for testing the fix
Fix seems to work! Thank you @boonebgorges @danielhuesken
Description of the bug
In https://github.com/bueltge/wordpress-multisite-enhancements/commit/9063da7b1fd0a3c691f99953d5a7484d6fed9993 you modified the admin-bar routine so that the current blog is skipped when no comment node can be found. However, because this happens inside a
switch_to_blog()
loop, the next call toswitch_to_blog()
causes the next blog_id to be added to the top of the "switched" stack. Then, whenrestore_current_blog()
is finally called, the incorrect blog is return. This results in data corruption when the rest of the page is rendered, since WP thinks we're on the wrong blog.Reproduction instructions
$comment_node
Expected behavior
The correct data will load.
Environment info
No response
Relevant log output
No response
Additional context
The fix is to add a
restore_current_blog()
call just beforecontinue
:I can send a PR if it's preferred.
Code of Conduct