Page MenuHomePhabricator

TypeError: this.options.badges.map is not a function
Closed, ResolvedPublic

Description

I wanted to mark the fawiki version of https://www.wikidata.org/wiki/Q40112 as a Good Article (it just got promoted as such). When I clicked on the badges icon next to its entry I got this error in the browser console: TypeError: this.options.badges.map is not a function. I reloaded the page in debug mode, and this is the part of jquery.wikibase.badgeselector.js that seems to trigger the error:

		/**
		 * Fills the menu with a menu item for each badge that may be assigned.
		 *
		 * @return {jQuery.Promise}
		 *         No resolved parameters.
		 *         No rejected parameters.
		 */
		_fillMenu: function () {
			var self = this,
				deferred = $.Deferred(),
				badgeIds = this.options.badges.map( function ( cssClasses, itemId ) {
					return itemId;
				} );

Event Timeline

Huji triaged this task as Unbreak Now! priority.Jan 17 2019, 2:13 AM

Marking UBN as this has made it impossible for me to use Wikidata for this purpose and no workaround exists either.

Change 484978 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Fix js type error when adding badges to items

https://gerrit.wikimedia.org/r/484978

Change 484979 had a related patch set uploaded (by Addshore; owner: Michael Große):
[mediawiki/extensions/Wikibase@wmf/1.33.0-wmf.13] Fix js type error when adding badges to items

https://gerrit.wikimedia.org/r/484979

Change 484979 merged by Addshore:
[mediawiki/extensions/Wikibase@wmf/1.33.0-wmf.13] Fix js type error when adding badges to items

https://gerrit.wikimedia.org/r/484979

Mentioned in SAL (#wikimedia-operations) [2019-01-17T12:58:17Z] <addshore@deploy1001> Synchronized php-1.33.0-wmf.13/extensions/Wikibase/view/resources/jquery/wikibase/jquery.wikibase.badgeselector.js: T213998 Fix js type error when adding badges to items (duration: 00m 53s)

Addshore lowered the priority of this task from Unbreak Now! to Medium.Jan 17 2019, 1:03 PM
Addshore subscribed.

This should now be fixed on wikidata.org.
We still have to get the patch merged into master though so this ticket is going to stay open

Change 484978 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix js type error when adding badges to items

https://gerrit.wikimedia.org/r/484978

Huji claimed this task.

Confirming that this works properly on Wikidata now.

Seeing that it is merged on master, I am closing the task as well. Great work everyone!