Last modified: 2013-04-18 22:05:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36589, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34589 - Content of <references/> not shown when other parser extensions are active
Content of <references/> not shown when other parser extensions are active
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-22 10:24 UTC by T. Gries
Modified: 2013-04-18 22:05 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description T. Gries 2012-02-22 10:24:43 UTC
While debugging the Extension:AJAXPoll, I noticed again, that when having a
<pre>
<poll>
...
</poll>
</pre>
section on the page with <ref>...</ref>, the

 <references />

are not shown. The same happened with DynamicPageList or SubPageList3 on the same page.
Comment 1 Daniel Renfro 2013-02-22 21:04:05 UTC
I can second this behavior. Whenever there are other parser tags on the page (and sometimes I find that even simple template-calls), the <references /> section fails silently. It generates no HTML, and throws no PHP errors. 

The need for a footnote is function of page length and complexity. However, due to this bug sufficiently complex pages that require footnotes fail to get them because the functionality fails. This is definitely a bug.
Comment 2 Daniel Renfro 2013-02-22 21:26:45 UTC
This is a bug with the Cite::clearState() method, which clears the state of the Cite object (which is for some reason assigned as a property of the parser) when the parser's state get's cleared. 

The intended function seems to be to avoid getting cross-page-references, but a side-effect is the loss of references when the parser's state is cleared (possibly after a template is called.)
Comment 3 T. Gries 2013-02-22 21:35:38 UTC
This bug is soooo old and was already in pre-2012 versions. I would be very happy if you can fix it.
Comment 4 Brad Jorsch 2013-02-22 21:41:39 UTC
This sounds suspiciously like bug 32368. Can you try it with Gerrit change #33508 applied to Cite?
Comment 5 Brad Jorsch 2013-02-22 21:42:17 UTC
Sigh. Repeat "Gerrit change #33508" so it links.
Comment 6 Daniel Renfro 2013-02-25 16:01:12 UTC
I took a look at this, and am completely confused...bug 32368 seems to have fixed a slightly different problem: when one parser clears the state of another (if I'm understanding it correctly.) I think the problem here is that the state of Cite _shouldn't_ be cleared each time Parser::clearState() is called. I can't figure out when Parser::clearState() is called, nor any logic that I can use to drop out of Cite::clearState early. 

I'd love to do something like this (in Cite::clearState):

  if ( /* we're still parsing the same article */ ) {
      return true;  // don't lose Cite's state
  }
Comment 7 Platonides 2013-02-25 16:04:06 UTC
Can you provide a simple testcase that is failing?
Comment 8 Brad Jorsch 2013-02-25 16:44:15 UTC
(In reply to comment #6)
> I can't figure out when Parser::clearState() is called,

Probably in MessageCache with its cloned parser, which is bug 32368. Or else one of the extensions you're using is broken and is calling Parser::parse() where it should be using Parser::recursiveTagParse(), in which case it's a bug in that extension.
Comment 9 Daniel Renfro 2013-02-25 18:20:18 UTC
Unfortunately I can't link to an example where this fails because I'm working on a private, enterprise wiki. However, Brad's comments make sense to me and I'm going to do some digging -- I'll try to report back here. Thanks, all.
Comment 10 Daniel Zahn 2013-04-18 22:05:27 UTC
fyi: the issue with linking gerrit issues when there is a line break in them that appeared as a "side bug" on this one is now fixed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links