Last modified: 2013-04-22 16:16:03 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.
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.
Taking this bug. https://gerrit.wikimedia.org/r/#/c/23508/
Fixed, with solution 1.