Last modified: 2011-08-25 08:55:49 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 T28533, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26533 - Collection extension should accept lists of chapters generated by templates (e.g. expanding templates of a collection page before loading the collection)
Collection extension should accept lists of chapters generated by templates (...
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Collection (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Help:Boo...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-01 19:19 UTC by Helder
Modified: 2011-08-25 08:55 UTC (History)
3 users (show)

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


Attachments

Description Helder 2011-01-01 19:19:13 UTC
As mentioned on [[Help:Books/Feedback/Archives/2010/May#The_extension_is_not_parsing_templates]], the extension is not expanding templates before loading a collection.

Currently, in the function loadCollection[1] we have a loop for parsing each line of the collection, but it uses the value of $article->getContent() in the following loop

 foreach ( preg_split( '/[\r\n]+/', $article->getContent() ) as $line ) {

Instead of that, it should be used the preprocessed text, such as that which appears on [[Special:ExpandTemplates]]. The code of this ExpandTemplates extension uses

 $output = $wgParser->preprocess( $input, $title, $options );

to get the expanded content in the special page. I believe the same function can be used for Collection extension.


[1] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Collection/Collection.body.php?view=markup
[2] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ExpandTemplates/ExpandTemplates_body.php?revision=77003&view=markup
Comment 1 Helder 2011-04-16 15:14:29 UTC
Maybe it could have also an API parameter to which the users could provide the name of a page whose (expanded) content would be used to load a collection.
Comment 2 Bugmeister Bot 2011-08-19 19:12:29 UTC
Unassigning default assignments. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/54734
Comment 3 Ralf Schmitt 2011-08-25 08:55:49 UTC
There are some reasons why we won't implement that:

1. We'd like to keep it simple. Currently collection pages can be parsed using some simple regular expressions. If we would allow templates, one would need to write a complete template expander in order to parse them (or rely on mediawiki's expander). 

2. There's no way I can think of to load and save those books from the collection interface while at the same time keeping calls to templates intact in the general case (when saving a collectionpage).

3. We'd like to able to use template syntax as a way to store additional meta-information about the book, like in:
{{saved_book
 |title=Hadronic Matter
 |subtitle=An overview
 |cover-image=Quark structure proton.svg
 |cover-color=
}}

at the top of a collectionpage.

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


Navigation
Links