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 created this task.Jan 17 2019, 2:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 17 2019, 2:12 AM
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.

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptJan 17 2019, 2:13 AM
Huji updated the task description. (Show Details)Jan 17 2019, 2:14 AM
Addshore moved this task from incoming to in progress on the Wikidata board.Jan 17 2019, 9:10 AM

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 Normal.Jan 17 2019, 1:03 PM
Addshore added a subscriber: Addshore.

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 closed this task as Resolved.Jan 17 2019, 8:43 PM
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!

Framawiki reassigned this task from Huji to Addshore.Jan 22 2019, 9:46 PM
Restricted Application added a project: User-Addshore. · View Herald TranscriptJan 22 2019, 9:46 PM