Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent doubled output if hook is called repeatedly #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vonloxley
Copy link

MediaWiki, at least since version 1.39, calls the SkinAfterBottomScripts hook twice. This patch prevents the output from being doubled.

@Seb35
Copy link
Collaborator

Seb35 commented Oct 26, 2023

Your patch probably works in your case, but I’m a bit embarassed because it’s a bit hacky and I don’t (always) observe the issue:

@Seb35
Copy link
Collaborator

Seb35 commented Oct 26, 2023

Searching a bit more, indeed there might be two executions of the hook SkinAfterBottomScripts between 1.37 included and 1.39 included, but there is only one execution in 1.40 and 1.41.

Between 1.37 and 1.38, there are calls of the hook both in includes/skins/Skin.php and includes/OutputPage.php, and in 1.39 two calls in includes/OutputPage.php.

I thought it was a bad interaction with some other extension, but it seems MediaWiki itself is the cause.

@Seb35
Copy link
Collaborator

Seb35 commented Oct 26, 2023

Contrary to my previous comment, there is no issue in 1.37 and 1.38. The issue appears with 1.39.0 (this commit) and is present in 1.40.0.

It was fixed in 1.39.5 and 1.40.1, see this Phabricator task for MediaWiki.

So I propose to users experiencing this issue to update the MediaWiki core to fix the problem.

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.

2 participants