Skip to content

[3.0] Drop the two moderation blocks nothing renders - #9402

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/moderation-dead-blocks
Open

[3.0] Drop the two moderation blocks nothing renders#9402
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/moderation-dead-blocks

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Themes/default/ReportedContent.template.php carries template_reported_posts_block() and template_reported_members_block(). Neither can be reached.

The moderation centre home is the only thing that asks for blocks. Sources/Actions/Moderation/Home.php registers them as:

'r'  => [… 'sub_template' => 'reported_posts_block'  …],
'rm' => [… 'sub_template' => 'reported_users_block'  …],

and calls Theme::loadTemplate('ModerationCenter'), which supplies both. Sources/Actions/Moderation/ReportedContent.php is what loads this file, and it only ever sets reported_posts, reported_members, viewmodreport, viewmemberreport or edit_comment. Nothing in the tree names either _block function:

Sources/Actions/Moderation/Home.php:59        'sub_template' => 'reported_posts_block',
Themes/default/ModerationCenter.template.php  function template_reported_posts_block()   ← the live one
Themes/default/ReportedContent.template.php   function template_reported_posts_block()   ← this
Themes/default/ReportedContent.template.php   function template_reported_members_block() ← this

Two reasons to take them out rather than leave them:

  • The copy here has drifted. It builds its list from mc_reportedp_subject_author and $report['report_href'], where the live one in ModerationCenter.template.php uses mc_post_report and $post['report_link']. Anyone reading it to understand the block reads the wrong version.
  • The name collides. Both files define template_reported_posts_block(), so anything that got them loaded in the same request — a mod adding a block, an integration hook doing its own loadTemplate() — 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 undefined mc_recent_member_reports string 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.php as before. php -l clean, php-cs-fixer clean.

Found while splitting #7933.

Issues References (Fixes|Related|Closes)

Related to #7933

@albertlast albertlast mentioned this pull request Aug 8, 2026
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 6 milestone Aug 8, 2026
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
albertlast force-pushed the 3.0/moderation-dead-blocks branch from e0db9d5 to 9c697f0 Compare August 9, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants