MediaWiki talk:Gadget-wrcAddNewIndividual.js

From Meta, a Wikimedia project coordination wiki

Please remove the following block of code from all three pages listed above:

if ( userLang == 'en' ) {
		userLang = 'en-foo'; // quick hack fix
}

The thing it was trying to work around was fixed by gerrit:496113 and/or gerrit:723813, and gerrit:713601 means that the workaround itself now fails (and results in the gadgets in question being entirely non-functional for users whose interface language is English). @DAlangi (WMF): * Pppery * it has begun 03:26, 6 December 2021 (UTC)[reply]

Thank you for reporting. Fixed! --DAlangi (WMF) (talk) 10:58, 6 December 2021 (UTC)[reply]
@DAlangi (WMF): You seem to have forgotten to make the change to MediaWiki:Gadget-wrcEditor-core.js. * Pppery * it has begun 15:58, 6 December 2021 (UTC)[reply]
Thanks for spotting. Fixed. NOTE: I'm not the one currently maintaining the project these days, but sure I'm happy to make any changes when spotted. --DAlangi (WMF) (talk) 16:02, 6 December 2021 (UTC)[reply]

In MediaWiki:Gadget-wrcEditor-core.js, please change

options: [
						new OO.ui.MenuOptionWidget( {
							data: 'Contact and Questions',
							label: gadgetMsg[ 'category-contact-and-questions' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Skills Development',
							label: gadgetMsg[ 'category-skills-development' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Grants Support',
							label: gadgetMsg[ 'category-grants-support' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Programs Support',
							label: gadgetMsg[ 'category-programs-support' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Software Basics',
							label: gadgetMsg[ 'category-software-basics' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Software Development',
							label: gadgetMsg[ 'category-software-development' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Technical Infrastructure',
							label: gadgetMsg[ 'category-technical-infrastructure' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Global Reach Partnerships',
							label: gadgetMsg[ 'category-global-reach-partnerships' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Legal',
							label: gadgetMsg[ 'category-legal' ]
						} ),
						new OO.ui.MenuOptionWidget( {
							data: 'Communications',
							label: gadgetMsg[ 'category-communications' ]
						} )
					]

to

options: [
						{
							data: 'Contact and Questions',
							label: gadgetMsg[ 'category-contact-and-questions' ]
						},
						{
							data: 'Skills Development',
							label: gadgetMsg[ 'category-skills-development' ]
						},
						{
							data: 'Grants Support',
							label: gadgetMsg[ 'category-grants-support' ]
						},
						{
							data: 'Programs Support',
							label: gadgetMsg[ 'category-programs-support' ]
						},
						{
							data: 'Software Basics',
							label: gadgetMsg[ 'category-software-basics' ]
						},
						{
							data: 'Software Development',
							label: gadgetMsg[ 'category-software-development' ]
						},
						{
							data: 'Technical Infrastructure',
							label: gadgetMsg[ 'category-technical-infrastructure' ]
						},
						{
							data: 'Global Reach Partnerships',
							label: gadgetMsg[ 'category-global-reach-partnerships' ]
						},
						{
							data: 'Legal',
							label: gadgetMsg[ 'category-legal' ]
						},
						{
							data: 'Communications',
							label: gadgetMsg[ 'category-communications' ]
						},
					]

This should fix the long-standing (apparently since gerrit:482729 in January 2019) bug in which the "Category" dropdown is disabled and any edit made using the gadget removes the "category" field from the module and causes a Lua error and matches the documentation for the correct syntax to use at mw:OOUI/Widgets/Inputs#Dropdown inputs. For examples of edits broken by this bug, see Special:Diff/22419425, Special:Diff/21193981. @DAlangi (WMF): * Pppery * it has begun 18:03, 6 December 2021 (UTC)[reply]

Thanks again for reporting Pppery. Let me know if the edit fixes the issue you reported. --DAlangi (WMF) (talk) 11:37, 7 December 2021 (UTC)[reply]
Confirmed fixed. * Pppery * it has begun 14:41, 7 December 2021 (UTC)[reply]