Page MenuHomePhabricator

Translate extension conflicts with Header-Footer extension (creates duplicate footers)
Closed, InvalidPublic

Description

Extension:Header Footer provides per-namespace and per-page header and footer inclusion. This is how Extension:Header Footer works.

Now, let's say we have page "Test" translated to russian as page "Test/ru".

A. In my wiki I have enabled a namespace footer for all pages of the Main namespace. The footer shows fine in page "Test". But in page "Test/ru" there 2 instances of the footer, one below the page and one above.

The top footer has a line below it. That indicates that is included in Translates header somehow.

B. If I use magic word to suppress footer in original page "test" (and retranslate it), then the new "test/ru" has only one footer, the one on top!

A + B conclude that:

  1. the bottom footer is the "Test"'s footer that Translate copied it somehow (where it shouln't have because it's not part of the page's content wikitext), and
  2. the top footer is the legitimate namespace footer automatically created for every page but it is in the wrong place!

Indeed, If I completely remove Extension:Translate from LocalSettings.php, then the footer appears where it should be, i.e. at the bottom.

See screenshots for better understanding: https://www.mediawiki.org/wiki/File:Translate_vs_Header-Footer.png


Version: REL1_21-branch
Severity: normal
URL: https://www.mediawiki.org/wiki/Extension:Header_Footer
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=40694

Details

Reference
bz53872

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:58 AM
bzimport set Reference to bz53872.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for reporting this!
This is about MediaWiki 1.21.x?

Wondering if this should rather end up in https://github.com/jamesmontalvo3/MediaWiki-HeaderFooter/issues and which codebase to "fix". :-/

FYI: Translate extension is using ArticleViewHeader hook and RequestContext::getMain()->getOutput()->addHtml() to inject the header. What does HeaderFooter use?

(In reply to comment #1)

This is about MediaWiki 1.21.x?

Both 1.21.1 and 1.21.2 now.

Wondering if this should rather end up in
https://github.com/jamesmontalvo3/MediaWiki-HeaderFooter/issues and which
codebase to "fix". :-/

Yes, I will report it there as well

(In reply to comment #2)

FYI: Translate extension is using ArticleViewHeader hook and
RequestContext::getMain()->getOutput()->addHtml() to inject the header. What
does HeaderFooter use?

I am not sure I fully undestand the code but it seems as a really simple extension. In HeaderFooter.php ( https://github.com/jamesmontalvo3/MediaWiki-HeaderFooter/blob/master/HeaderFooter.php ) I see an OutputPageParserOutput hook which is documented as "Called after parse, before the HTML is added to the output". Does this mean that the header or footer wikitext is injected in the page content as if it was part of the page's original wikitext? If such is the case then I think Translate cannot do anything about it and must be solved by the Header-Footer side. Am I right?

But still, I cannot figure out why the translated page has the footer on top!

HeaderFooter.body.php might also help ( https://github.com/jamesmontalvo3/MediaWiki-HeaderFooter/blob/master/HeaderFooter.body.php ), (it's small, just 75 lines).

Pretty sure this is stuff to fix in the Header-Footer extension instead, instead of Translate. Plus not much we can do without knowing details of what HeaderFooter does (no feedback in Gtihub ticket either).