Skip to content

Implement Dormancy Policy sitenotices#9

Open
ghost wants to merge 8 commits into
mainfrom
dormancy
Open

Implement Dormancy Policy sitenotices#9
ghost wants to merge 8 commits into
mainfrom
dormancy

Conversation

@ghost

@ghost ghost commented Jul 1, 2026

Copy link
Copy Markdown

No description provided.

Comment thread includes/HookHandlers/Main.php Outdated
$siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/0/02/Wiki_lock.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'sitenotice-wiki-closed' )->parse() . '</span></div>';
}
} elseif ( $cwConfig->get( 'Inactive' ) && $cwConfig->get( 'Inactive' ) !== 'exempt' ) {
$siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/5/5f/Out_of_date_clock_icon.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'wiki-sitenotice-inactive' )->parse() . '</span></div>';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The i18n message key wiki-sitenotice-inactive is incorrect and does not match the sitenotice-wiki-inactive key in the localization file, causing a broken message to be displayed.
Severity: MEDIUM

Suggested Fix

In includes/HookHandlers/Main.php, change the message key from wiki-sitenotice-inactive to sitenotice-wiki-inactive to match the key defined in the i18n/wikioasis/en.json file.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: includes/HookHandlers/Main.php#L451

Potential issue: There is a mismatch between the internationalization (i18n) message key
used in the PHP code and the key defined in the localization file. The code in
`includes/HookHandlers/Main.php` calls for the message key `wiki-sitenotice-inactive`.
However, the corresponding definition in `i18n/wikioasis/en.json` is
`sitenotice-wiki-inactive`. When a wiki is marked as 'Inactive', the message system will
fail to find the correct key and will fall back to displaying the raw key identifier
`⧼wiki-sitenotice-inactive⧽` to users instead of the intended human-readable notice.

Also affects:

  • i18n/wikioasis/en.json:120~120

Did we get this right? 👍 / 👎 to inform future reviews.

Comment thread includes/HookHandlers/Main.php Outdated
MessageCacheFetchOverridesHook,
MimeMagicInitHook,
SiteNoticeAfterHook,
AfterHook,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a real hook

Comment thread includes/HookHandlers/Main.php Outdated

if ( $cwConfig->get( 'Closed' ) ) {
if ( $cwConfig->get( 'Private' ) ) {
$siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/0/02/Wiki_lock.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'sitenotice-wiki-closed-private' )->parse() . '</span></div>';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still references Miraheze

Comment thread includes/HookHandlers/Main.php Outdated
}*/
$cwConfig = new GlobalVarConfig( 'cw' );

if ( $cwConfig->get( 'Closed' ) ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just use a switch case here instead of some weird if elif stuff?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's going to be possible, or at minimum easier than the current solution.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fair enough

Tali64 and others added 5 commits July 1, 2026 19:51
Brings in the MediaWiki CI workflow and code fixes from #10 (tab
reformatting, dead-code/config cleanup, sentry dependency, etc.),
carrying the dormancy sitenotice feature forward onto the reformatted
Main.php and adding the missing GlobalVarConfig use import it needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant