Last modified: 2013-04-22 16:16:03 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 T42159, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40159 - Babel extension automatically creates categories on page preview
Babel extension automatically creates categories on page preview
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Babel (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Dereckson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-11 09:38 UTC by Malafaya
Modified: 2013-04-22 16:16 UTC (History)
4 users (show)

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


Attachments

Description Malafaya 2012-09-11 09:38:38 UTC
When editing my #babel parameters, I made a test and inserted zh-hans-N in the English Wiktionary. I simply previewed the page in order to see the result and realized that the Babel categories had been automatically created at that time.

The categories should only be created on page save, and not on preview.
Comment 1 Dereckson 2012-09-12 13:42:50 UTC
Thank you for your bug report.

[ Current code analysis ]

In the extension, the {{#babel}} is currently a tag to render. This uses setFunctionHook - https://www.mediawiki.org /wiki/Manual:Parser_functions#The_setFunctionHook_hook - and create needed categories.

The rendering operation is done in Babel::Render static method (Babel.class.php).

This method calls mGenerateCategories, which calls twice BabelAutoCreate::create to create relevant code and code/level categories.


[ Solutions to fix this ]

1. Check $parser->mOptions->mIsPreview in Render() and add a automatic categories creation parameter to mGenerateCategories method (Gerrit change #23508)

2. Consider having an empty category isn't an issue (-> RESO WONTFIX)

3. Add an option to let configure if we want or not the category automatic creation at preview time.


[ Side effect ]

User could want to create categories themselves in preview mode, if they see them not existent, or could avoid the code, being afraid this is wrong.
Comment 2 Dereckson 2012-09-12 13:44:51 UTC
Taking this bug.

https://gerrit.wikimedia.org/r/#/c/23508/
Comment 3 Dereckson 2012-09-17 19:52:08 UTC
Fixed, with solution 1.

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


Navigation
Links