[3.0] Drop the two moderation blocks nothing renders - #9402
Open
albertlast wants to merge 1 commit into
Open
Conversation
Closed
ReportedContent.template.php carries template_reported_posts_block() and template_reported_members_block(). Neither is reachable: the moderation centre home is the only thing that asks for blocks, it registers reported_posts_block and reported_users_block, and it loads ModerationCenter.template.php, which supplies both. ReportedContent.php loads this file and only ever sets reported_posts, reported_members, viewmodreport, viewmemberreport or edit_comment. The copy of template_reported_posts_block() here is an older one, still building its list from mc_reportedp_subject_author and report_href where the live one uses mc_post_report and report_link. Because both files define the same function, anything that got them loaded in the same request - a mod adding a block, an integration hook - would fatal on the redeclaration rather than pick one. template_reported_members_block() is where the undefined mc_recent_member_reports string was, so that goes with it. Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
albertlast
force-pushed
the
3.0/moderation-dead-blocks
branch
from
August 9, 2026 17:02
e0db9d5 to
9c697f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Themes/default/ReportedContent.template.phpcarriestemplate_reported_posts_block()andtemplate_reported_members_block(). Neither can be reached.The moderation centre home is the only thing that asks for blocks.
Sources/Actions/Moderation/Home.phpregisters them as:and calls
Theme::loadTemplate('ModerationCenter'), which supplies both.Sources/Actions/Moderation/ReportedContent.phpis what loads this file, and it only ever setsreported_posts,reported_members,viewmodreport,viewmemberreportoredit_comment. Nothing in the tree names either_blockfunction:Two reasons to take them out rather than leave them:
mc_reportedp_subject_authorand$report['report_href'], where the live one inModerationCenter.template.phpusesmc_post_reportand$post['report_link']. Anyone reading it to understand the block reads the wrong version.template_reported_posts_block(), so anything that got them loaded in the same request — a mod adding a block, an integration hook doing its ownloadTemplate()— fatals on the redeclaration instead of picking one. It only works today because no core path loads both.template_reported_members_block()is also where the undefinedmc_recent_member_reportsstring was, flagged in #9399 and left alone there because deleting the function was the better answer.Checked
Moderation centre home, Reported Posts and Reported Members all still render, no redeclaration, and "Recent Topic Reports" still comes from
ModerationCenter.template.phpas before.php -lclean,php-cs-fixerclean.Found while splitting #7933.
Issues References (Fixes|Related|Closes)
Related to #7933