Page MenuHomePhabricator

Request Hook in Cite.php function stack
Closed, DeclinedPublicFeature

Description

Author: jimhu

Description:
For an extension to Cite that I am working on (http://www.mediawiki.org/wiki/Extension:ProcessCite), I added the following hook to Cite.php at the
beginning of the function stack:

wfRunHooks( 'CiteBeforeStackEntry', array( &$key, &$str ) );

I am using this to do additional processing of $key and $str. The functionality of my extension, which I am calling ProcessCite.php for now, can be seen at
http://ecoliwiki.net/colipedia/index.php/Help:References

In brief, ProcessCite:

  1. fetches, caches, and formats reference info for citations to papers in the NLM PubMed database, using PubMed's E-Utilities web service.
  2. fetches reference information from a list of commonly used shortcuts stored in a specific wiki page
  3. allows more concise markup of these kinds of citations
  4. disambiguates several ways in which citations might be entered into Cite.

ProcessCite is written with biomedical/genomics wikis in mind, but and I think that other Cite extensions could be written along the same lines.


Version: unspecified
Severity: enhancement
URL: http://ecoliwiki.net/colipedia/index.php/Help:References

Details

Reference
bz9091

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:38 PM
bzimport added a project: Cite.
bzimport set Reference to bz9091.

ssanbeg wrote:

Wouldn't it be almost as easy for your extension to subclass Cite? Then you could provide whatever hooks you wanted by overriding the appropriate methods. The structure shouldn't change too often, so the maintenance shouldn't be too involved.

jimhu wrote:

Interesting alternative. But it seems like it could be more baroque to have my extension just to provide hooks into Cite, and then have other extensions depend on that, instead of just adding one line of code to Cite.

Bumping --

Cite has gotten a bit more complicated, with support for multiple groups. If this is still required, where should it go and what parameters should it take?

jimhu wrote:

Thanks Brion,

I will look at the version of Cite in svn to try to answer these questions.

Qgil lowered the priority of this task from Medium to Lowest.
Qgil set Security to None.

@brion, @Mvolz, I wonder whether you could help assessing whether this request still makes sense.

fwiw https://www.mediawiki.org/wiki/Extension:ProcessCite is currently used by 8 MediaWiki instances, and I'm not sure any of them requires this hook.

Unfortunately I don't know anything about the Cite extension at all; maybe ask Timo or Roan?

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM
thiemowmde subscribed.

Hooking into the (private) guts of the Cite extension is something that should only be done when we are sure there is no other way. But given https://www.mediawiki.org/wiki/Extension:ProcessCite is marked as unmaintained since 2013 this request appears to be obsolete anyway.