MediaWiki talk:Gadget-AuthorityControl.js/Archive/2016

From Wikidata
Jump to navigation Jump to search

URL formatter problems?

Sometimes URL get not formated, f. e. GND Numbers clickable to extern sites. Reload help often. What about used propertys in references as IPNI author ID (P586) via botanist author abbreviation (P428) in Edmond Boissier (Q34430). Will this ID number also sometimes get clickable? Thank you, Conny (talk) 12:52, 7 February 2015 (UTC).

There is sometimes a problem with a race condition. The solution is unknown.
Qualifier are currently not linked. This can implemented when needed. Why is IPNI author ID (P586) here used as a qualifier? It doesn't look like a qualifier. --Fomafix (talk) 15:14, 7 February 2015 (UTC)
Ok, thank you. Please help me: that means my example in Michael Ballack (Q11948) using ID-propertys for date of birth (P569) as sources are not right too? Conny (talk) 21:49, 7 February 2015 (UTC).
Munzinger Sport number (P1285) as reference of date of birth (P569) for Michael Ballack (Q11948) get linked by Gadget-AuthorityControl.js because Munzinger Sport number (P1285) is also used as property. Funny. From programming view a reference is similar to a qualifier. From the semantic view it is a difference. I don't know if the usage as a reference here makes sense. --Fomafix (talk)
@Conny: For use in references we have the Munzinger-Sport-item Munzinger Sport (Q18927195) (I just made up the connection by adding Wikidata item of this property (P1629) to Munzinger Sport number (P1285)). -- Gymel (talk) 01:21, 8 February 2015 (UTC)
I asked here, which way makes sense. I prefer property one, because the URL from the second we have via ID of Munzinger. 12:40, 8 February 2015 (UTC).
I think the developers are indifferent between the two variants, because this is a content decision not a developer decision. Just for AuthorityControl a development is necessary to support qualifier or references. --Fomafix (talk) 13:08, 8 February 2015 (UTC)
Admittedly replicating the automatic URI from the property for reference purposes is a nuisance. However using the property inside a reference might turn out logically unsound: The value of the property is an identifier for the item, not for the reference or the web site it may point to by help of P1630. Or to put it differently: What does it really mean, if instead of saying "item X (a "work") serves as a reference of type 'stated in (P248)' for this birth-date claim" we formulate "string S (an "identifier" which might be expandable to an URL) serves as a reference of type Munzinger Sport number (P1285) for this birth-date claim"? I understand the intention, namely to have a shorthand notation to point to the specific other property of the many in the item which can support the claim. And in a sense supplying the property is "more semantic" than explicitly providing a reference URL (P854).
Yet another twist: Assume we have an item about Michael Ballack's father and the only source for his birth date is the Munzinger article about Michael Ballack. Would we really want to express
⟨ M.B.'s Father ⟩ date of birth (P569) View with SQID ⟨ 19xx ⟩
with
⟨ reference ⟩ Munzinger Sport number (P1285) View with SQID ⟨ number for M.B. ⟩
? -- Gymel (talk) 14:33, 8 February 2015 (UTC)
The technical problem with the race conditions still persists, one year and several tweaks of the interface later: Sometimes some authority control IDs are not linked. Reload sometimes helps, sometimes it does not (I believe it is less likely to break if you successfully loaded the authority control links for that very item once and reload it then, but this might be imagination). It affects current versions, old versions and diff views (thus very nasty e.g. when checking possible vandalism edits changing some authority IDs), and items with numerous or only one authority control statement (so no conflict between several statements of one item). No error is displayed in Firefox' JavaScript console. Not specific to any browser (happens to me on Firefox, Chrome, Internet Explorer, Opera Mobile) or any non-default user scripts/gadgets (happens without being logged in, too). Someone got an idea? --YMS (talk) 12:17, 17 February 2016 (UTC)
This problem should get solved now with the move to the external identifier datatype. We're doing the linking for those in the backend and it'll be much less flaky because of that. The sooner we get the existing string properties checked and migrated the sooner it'll be solved for most cases :) --Lydia Pintscher (WMDE) (talk) 11:33, 18 February 2016 (UTC)

P426

If the strings starts with "N", would link the following?

http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt=

Thanks. --- Jura 11:45, 7 October 2015 (UTC)

{{Editprotected}}

Code
function makeLink( numericPropertyId, linkValue, displayText ) {
	var linkTemplate = PROPERTIES[ numericPropertyId ];

	if (numericPropertyId == 426) {
		if ( value.substring( 0, 1 ) == 'N' ) {
			linkTemplate = "http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt=$1"
		} elseif ( value.substring( 0, 2 ) == 'G-' ) {
			linkTemplate = "https://www.caa.co.uk/application.aspx?catid=60&pagetype=65&appid=1&mode=detailnosummary&fullregmark=$1";
			linkValue = linkValue.substring(2)
		} else { 
			linkTemplate = "$1"
		}
	}

	return $( '<a>' )
		.text( displayText )
		.attr( 'href', linkTemplate.replace( /\$1/g, linkValue ) )
		// Show the 'external link' icon:
		.addClass( 'external' );
}
The above should solve this. Other registries could be added.
--- Jura 14:58, 7 February 2016 (UTC)
✓ Done - Turned it in a switch for the property id. And elseif doesn't exist in javascript, that's else if. Mbch331 (talk) 15:15, 7 February 2016 (UTC)

{{Editprotected}} Great, thanks! The code seems to work except for when neither applies. Maybe the below works better.
--- Jura 15:47, 7 February 2016 (UTC)

Code
                } else { 
                        return $( displayText )
                }
That doesn't seem to be a solution. Check Kaleva (Q1464299) for example, that now displays nothing. Mbch331 (talk) 17:51, 7 February 2016 (UTC)
Found it: [1]. I set up a testing version for next time as well. Thanks for your help.
--- Jura 18:13, 7 February 2016 (UTC)
✓ Done - Only N and G- will be linked, others won't be. Mbch331 (talk) 18:31, 7 February 2016 (UTC)

IMDb

{{Editprotected}}

Code
	case 345: // IMDb
		linkValue = "/" + value;
		switch ( value.substring( 0, 2 ) {
		case "nm":
			linkValue = 'name' + linkValue + "/";
		case "tt":
			linkValue = 'title' + linkValue + "/";
		case "ch":
			linkValue = 'character' + linkValue + "/";
		case "ev":
			linkValue = 'event' + linkValue;
		case "co":
			linkValue = 'company' + linkValue + "/";
		 }
		break;

To fix the problem mentioned at Property_talk:P345#Problem_with_URL_generation, the inserting the above at line 50 might work. At the same time, the first formatter URL at Property:P345 needs to be changed to http://www.imdb.com/$1
--- Jura 09:55, 18 January 2016 (UTC)

@Jura1: Just to make sure you didn't miss anything, does "ev" really not get the "/"? (I would also use switch instead of repeating else if but it doesn't mind.) Matěj Suchánek (talk) 14:24, 18 January 2016 (UTC)
ev has a slash in the middle (before the year). If switch is more efficient, please use that. --- Jura 14:26, 18 January 2016 (UTC)
Actually, it depends on the string length. If there is no year, it would need a slash, but if it's missing, it redirects [2].
--- Jura 14:39, 18 January 2016 (UTC)
@Matěj Suchánek: do you think it needs some changes or can it be deployed?
--- Jura 08:35, 30 January 2016 (UTC)
I have just deployed it. Please, test it and tell me if there is a problem. Matěj Suchánek (talk) 09:09, 30 January 2016 (UTC)
Thanks. It seems to work just fine.
--- Jura 09:21, 30 January 2016 (UTC)

Read P972

To define urls for P528 and P1945, we would need to read the qualifier P972.
--- Jura 16:08, 7 February 2016 (UTC)

@Jura1: I have already created task for it and recently made a proposal how the code could look like. Matěj Suchánek (talk) 11:01, 26 June 2016 (UTC)
Thanks. I will give it a try.
--- Jura 09:35, 30 June 2016 (UTC)

Performance

Hey Everyone, I don't have time to look into this right now, but I think there are some easy to address performance issues in this gadget: Don't load the properties in case the values aren't strings (or geo?) and also (now that we have first class identifier support) only touch those statements that aren't already linked by Wikibase. I think that shouldn't be to hard to do, but the impact might be huge. Cheers, Hoo man (talk) 20:47, 17 February 2016 (UTC)

Fix coordinates links in qualifiers

Coordinates links are fixed only in mainsnaks, and are broken in qualifiers. See comment in line 186 185. --JulesWinnfield-hu (talk) 21:24, 24 February 2016 (UTC)

See on Q201653. --JulesWinnfield-hu (talk) 15:12, 25 February 2016 (UTC)

@Adrian Heine (WMDE): Could you help please, to match html and data for snaks in qualifiers? --JulesWinnfield-hu (talk) 12:12, 26 February 2016 (UTC)

First, Property:P625 shouldn't have a Property:P1630 statement because the value cannot simply be substituted. That would at least remove the wrong links. Adrian Heine (WMDE) (talk) 22:19, 26 February 2016 (UTC)
Currently the gadget does use that statement to display right links for mainsnaks. --JulesWinnfield-hu (talk) 22:40, 26 February 2016 (UTC)
Second, try replacing initGadget with the following two functions:
function handleSnak( snak, $snakView ) {
	if ( !( snak instanceof wikibase.datamodel.PropertyValueSnak ) ) {
		return;
	}

	var numericPropertyId = snak.getPropertyId().slice( 1 );
	if ( !( PROPERTIES.hasOwnProperty( numericPropertyId ) ) ) {
		return;
	}
	var $snakValue = $snakView.find( '.wikibase-snakview-value' ),
		displayText = $snakValue.text(),
		snakLink = createLinkForSnakValue( numericPropertyId, snak.getValue(), displayText );
	$snakValue.html( snakLink );
}

function initGadget() {
	$( ':wikibase-statementview' ).each( function () {
		var statementview = $.data( this, 'statementview' ),
			statement = statementview.value(),
			claim = statement.getClaim(),
			qualifierGroups = claim.getQualifiers().getGroupedSnakLists();

		handleSnak( claim.getMainSnak(), statementview.$mainSnak[0] );

		$( '.wikibase-statementview-qualifiers .wikibase-snaklistview', this ).each( function( i ) {
			var qualifiers = qualifierGroups[i].toArray();
			$( '.wikibase-snakview', this ).each( function( n ) {
				handleSnak( qualifiers[n], this );
			} );
		} );
		
	} );

	$( '.wikibase-referenceview .wikibase-snaklistview-listview' ).each( function () {
		linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' );
	} );
}

That should at least fix qualifiers.

Bye, Adrian Heine (WMDE) (talk) 23:00, 26 February 2016 (UTC)

Thank you! --JulesWinnfield-hu (talk) 23:10, 26 February 2016 (UTC)

{{Edit request}}

Please apply the fix. --JulesWinnfield-hu (talk) 23:10, 26 February 2016 (UTC)

✓ Done I hope it's fine now. Matěj Suchánek (talk) 13:58, 27 February 2016 (UTC)

Has some issues. handleSnak gets Element as $snakView not Object. Rename to snakView and wrap it in $(). --JulesWinnfield-hu (talk) 14:10, 27 February 2016 (UTC)

Fixed (do not add {{Edit request}} unless you have a code to apply). Matěj Suchánek (talk) 14:30, 27 February 2016 (UTC)

IMDb-ID

Derzeit gibt es folgendes Problem mit der Vorgeschlagenen IMDb-ID: Solange man die vorgeschlagene IMDb-ID im blau unterlegten Feld anklickt (obwohl die IMDb-ID stimmt), landet man auf einer 404 unter http://www.imdb.com/404. Erst wenn man diese übernommen hat ( [approve claim] Added via Wikidata:Primary sources tool), gelangt man zur eigentlichen Seite des Objekts in der IMDb. --Harry Canyon (talk) 08:17, 25 February 2016 (UTC)

Broken

{{Editrequest}} Hi,

I broke your stuff, sorry. If you replace createLinkForSnakValue and initGadget with the following two methods, it should work again:

function createLinkForSnakValue( numericPropertyId, dataValue, displayText ) {
	var dataValueType = dataValue.getType(),
		value = dataValue.toJSON();

	// @fixme shouldn't happen but in case of any unexpected data value types,
	// then there should be better error handling here.
	var linkValue = '';

	if ( dataValueType === 'string' ) {
		linkValue = getLinkValueForString( numericPropertyId, value );
	} else if ( dataValueType === 'globecoordinate' ) {
		linkValue = getGeoHackParams( value );
	}

	return makeLink( numericPropertyId, linkValue, displayText );
}
function initGadget() {
	$( ':wikibase-statementview' ).each( function () {
		var statementview = $.data( this, 'statementview' ),
			statement = statementview.value(),
			mainSnak = statement.getClaim().getMainSnak(),
			numericPropertyId = mainSnak.getPropertyId().slice( 1 ),

		if ( mainSnak instanceof wikibase.datamodel.PropertyValueSnak && PROPERTIES.hasOwnProperty( numericPropertyId ) ) {
			var displayText = snakview.$snakValue.text(),
				snakLink = createLinkForSnakValue( numericPropertyId, mainSnak.getValue(), displayText );

			snakview.$snakValue.html( snakLink );
		}
	} );

	/*
	@fixme this works for main snak, except for coordinates which need the data value
	$( '.wikibase-statementgroupview' ).each( function () {
		linkSnakView( this, '.wikibase-statementgroupview-property-label > a', '.wikibase-snakview-value' );
	} );
	*/
	$( '.wikibase-statementview-qualifiers' ).each( function () {
		linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' );
	} );

	$( '.wikibase-referenceview .wikibase-snaklistview-listview' ).each( function () {
		linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' );
	} );
}

Bye, Adrian Heine (WMDE) (talk) 14:05, 25 February 2016 (UTC)

Second try:

function initGadget() {
	$( ':wikibase-statementview' ).each( function () {
		var statementview = $.data( this, 'statementview' ),
			statement = statementview.value(),
			mainSnak = statement.getClaim().getMainSnak(),
			numericPropertyId = mainSnak.getPropertyId().slice( 1 ),
			$mainSnakValue = statementview.$mainSnak.find( '.wikibase-snakview-value' );

		if ( mainSnak instanceof wikibase.datamodel.PropertyValueSnak && PROPERTIES.hasOwnProperty( numericPropertyId ) ) {
			var displayText = $mainSnakValue.text(),
				snakLink = createLinkForSnakValue( numericPropertyId, mainSnak.getValue(), displayText );

			$mainSnakValue.html( snakLink );
		}
	} );

	/*
	@fixme this works for main snak, except for coordinates which need the data value
	$( '.wikibase-statementgroupview' ).each( function () {
		linkSnakView( this, '.wikibase-statementgroupview-property-label > a', '.wikibase-snakview-value' );
	} );
	*/
	$( '.wikibase-statementview-qualifiers' ).each( function () {
		linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' );
	} );

	$( '.wikibase-referenceview .wikibase-snaklistview-listview' ).each( function () {
		linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' );
	} );
}

Bye, Adrian Heine (WMDE) (talk) 09:57, 26 February 2016 (UTC)

✓ Done first and second try. Regards, --Ricordisamoa 10:15, 26 February 2016 (UTC)

Performance improvements (please review)

Hey folks, I've just spent a bit on implementing what I suggested in #Performance. The new (proposed) version of the gadget can be found here: phab:P2797. My new version loads fewer entities and improves the speed of initGadget considerably, so that for example the number of properties loaded on Barack Obama is reduced from 126 to 61 and the time spent in initGadget is reduced by 36%. It would be nice if someone else could have another look at my changes and then apply them.

In case external identifiers aren't already linked in the html, purging the page helps. Also I will probably purge the parser cache for all entities later today. Cheers, Hoo man (talk) 12:42, 21 March 2016 (UTC)

For catalog code (P528) and inventory number (P217), it would be helpful if one could use formatter urls from the mandatory qualifier catalog (P972), sample Messier object (Q14530).
--- Jura 13:07, 21 March 2016 (UTC)
That would be quite possible to do, but would need further tweaks in various places in the gadget. I don't think that is affected by what I'm doing here much, it just needs to be special cased so that we load the formatter URLs from the qualifiers (but that would have been needed anyway). Maybe it would be better to make specific properties for these also? Cheers, Hoo man (talk) 13:29, 21 March 2016 (UTC)
✓ Done updated the gadget! ·addshore· talk to me! 10:11, 6 April 2016 (UTC)

IMDB id not parsed correctly

The IMDb id's aren't parsed correctly anymore. It seems that the rules are ignored and just the first value for formatter URL (P1630) is used. See the examples on IMDb ID (P345) itself or 87th Academy Awards (Q16773560) for example. Mbch331 (talk) 20:51, 24 March 2016 (UTC)

CricketArchive

So with this gadget we can set a formatter URL for some property, right? Can we add URL for CricketArchive player ID (P2698)? Wikitext equivalent would be http://www.cricketarchive.com/Archive/Players/{{#expr:trunc({{{id}}}/1000)}}/{{{id}}}/{{{id}}}.html. We decided to store values at WD as simply id, so because of that trunc part, we can't set formatter URL for property itself. --Edgars2007 (talk) 07:21, 6 April 2016 (UTC)

✓ Done The property now needs http://www.cricketarchive.com/Archive/Players/$1.html as formatter URL (P1630). Matěj Suchánek (talk) 15:11, 6 April 2016 (UTC)
@Matěj Suchánek: I understand, why we need set P1630, but wouldn't that be misleading on client-side if you use formatter URL (P1630) directly from WD, as it would then generate 404s. Can't we set full URL here? --Edgars2007 (talk) 16:42, 6 April 2016 (UTC)
Well, IMDb ID (P345) is also "broken" this way... Matěj Suchánek (talk) 16:51, 6 April 2016 (UTC)
To avoid malformed urls, the property should either have string-datatype or the entire URL needs to be defined in the script and P1630 not added to the property.
--- Jura 17:02, 6 April 2016 (UTC)

SOC (2010)

{{Editrequest}} Related to SOC Code (2010) (P919), need a simple handler. The value is in the form ##-#### but the url doesn't use the hyphen (-).

Example: astronomer (Q11063): SOC Code (2010) (P919) = 19-2011 ; link is in the form http://www.bls.gov/soc/2010/soc192011.htm

Thanks in advance for your help. Let me know if you have any questions. -- Netoholic (talk) 11:06, 16 April 2016 (UTC)

✓ Done by Pasleim. Matěj Suchánek (talk) 14:26, 21 April 2016 (UTC)

URL-Formatters for Filmportal

Hello! Can anybody add URL-Formatters for Filmportal ID (P2639) (see Disk)? Queryzo (talk) 06:40, 25 April 2016 (UTC)

If this is purely cosmetic, why bother? Transformations by this gadget will only be applied in the desktop UI with JavaScript enabled, but not in any other outputs, thus this leads to inconsistent (derived) data. Cheers, Hoo man (talk) 11:48, 25 April 2016 (UTC)

Website account formatter URL

Website Count formatter URL Notes/Property
YouTube (Q866) 832 https://www.youtube.com/user/$1 Legacy username, failed proposal1, proposal2, proposal3; use YouTube channel ID (P2397)
VK (Q116933) 459 http://vk.com/$1
Google+ (Q356) 349 https://plus.google.com/$1 Proposal
LiveJournal (Q219523) 249 http://$1.livejournal.com/
Myspace (Q40629) 187 https://myspace.com/$1/
last.fm (Q183718) 132 http://www.last.fm/music/$1
Flickr (Q103204) 111 https://www.flickr.com/people/$1/
SoundCloud (Q568769) 106 https://soundcloud.com/$1
LinkedIn (Q213660) 91 - Use P2035 (P2035) instead
Ameblo (Q17988469) 77 http://ameblo.jp/$1/
Odnoklassniki (Q1123836) 74 https://m.ok.ru/profile/$1
My World@Mail.Ru (Q4299858) 72 ???
Facebook (Q355) 62 https://www.facebook.com/$1 See also: Facebook username (P2013)
Tumblr (Q384060) 61 http://$1.tumblr.com/
Pinterest (Q255381) 53 https://www.pinterest.com/$1/
Vimeo (Q156376) 52 https://vimeo.com/$1/
Wikipedia (Q52) 47 https://meta.wikimedia.org/wiki/User:$1
X (Q918) 44 https://twitter.com/$1 See also: X username (P2002)
PromoDj (Q17117201) 29 http://promodj.com/$1
Crunchbase (Q10846831) 27 https://www.crunchbase.com/$1 Require organization/ or person/ prefix. Should have the LinkedIn treatment.
Instagram (Q209330) 26 https://www.instagram.com/$1/
Weibo (Q92526) 18 http://weibo.com/$1
proza.ru (Q4380129) 13 https://www.proza.ru/avtor/$1
stihi.ru (Q4442644) 13 https://www.stihi.ru/avtor/$1
Snapchat (Q333618) 12 - No web viewable profile
Blogger (Q171186) 11 http://$1.blogspot.com/
Viadeo (Q181592) 11 http://www.viadeo.com/p/$1 Unsure if correct
LiveInternet (Q4043051) 11 http://www.liveinternet.ru/users/$1/profile/


website username or ID (P554) (a qualifier for website account on (P553)) it would be nice if the username were linked the website. Dispenser (talk) 14:48, 9 May 2016 (UTC)

  •  Comment The general idea is to convert them to individual properties once a certain level of uses is reached. For YouTube, use of P2397 seems preferred.
    --- Jura 15:21, 9 May 2016 (UTC)


ISNI

{{Edit protected}}

Please add

		case 213:
			linkTemplate = 'http://isni.org/isni/$1';
			break;

This way we can remove the formatter URL from ISNI (P213) and the links wont break when the datatype of the property changes.
--- Jura 21:52, 14 May 2016 (UTC)

Solved in the meantime.
--- Jura 08:37, 20 June 2016 (UTC)

BN (Argentine) URL

Hi, currently on line 1143 1143: 'http://catalogo.bn.gov.ar/F/?func=find-b&request=$1&find_code=SYS', // BN (Argentine) editions do a search in the catalog, but using http://catalogo.bn.gov.ar/F?func=myshelf_full&doc_number=$1 would just popup the right entry. If someone can change it, would be nice. Thanks! --Mauricio V. Genta (talk) 04:07, 20 May 2016 (UTC)

@Mauricio V. Genta: Your edit [3] at the propety item already did the trick! -- Gymel (talk) 06:36, 20 May 2016 (UTC)

P791

{{Edit protected}} "specialHandlingProperties" should probably include P791 as well (it's mentioned further down).
--- Jura 16:38, 2 June 2016 (UTC)

@Matěj Suchánek: can we add this?
--- Jura 08:43, 20 June 2016 (UTC)
✓ Done Matěj Suchánek (talk) 11:52, 20 June 2016 (UTC)

Special handling no longer needed for P213, P345, P502, P628, P919, P1323, P2698

{{Editprotected}} These properties have had formatter URL's modified to use the new wikidata external id redirection tool at http://tools.wmflabs.org/wikidata-externalid-url/ - this allows them to be linked directly in the external id section, but the new formatters are generally not compatible with the transformations performed by this authority control gadget. ArthurPSmith (talk) 14:58, 8 June 2016 (UTC)

✓ Done Matěj Suchánek (talk) 08:44, 19 June 2016 (UTC)

I think this solution goes into a wrong direction. I don't see an improvement in moving a part of the conversion algorithm to the toolserver. The target URL should be presented in the URL not a redirect URL. --Fomafix (talk) 08:29, 20 June 2016 (UTC)

Both approaches are sub-optimal, but apparently there are some dev coordination issues to actually solve the problem. At least the GUI part of property ordering is solved.
--- Jura 08:40, 20 June 2016 (UTC)

Substituting '+' for spaces

In the resulting URL of Property:P839 (type external-id), the spaces of the id get replaced by plus signs '+'; actually the destination site expects whitespaces or underscores:

IMSLP ID (P839) = "Die Walküre, WWV 86B (Wagner, Richard)"
resulting URL = http://imslp.org/wiki/Die+Walk%C3%BCre,+WWV+86B+(Wagner,+Richard)
desired URL = either of these
http://imslp.org/wiki/Die Walküre, WWV 86B (Wagner, Richard)
http://imslp.org/wiki/Die_Walk%C3%BCre,_WWV_86B_(Wagner,_Richard)
http://imslp.org/wiki/Die%20Walk%C3%BCre,%20WWV%2086B%20(Wagner,%20Richard)

I get lost in the latest code of this gadget, can someone figure where these + signs come from? thanks -- LaddΩ chat ;) 21:24, 29 June 2016 (UTC)

✓ Fixed via special handling. Note this is Wikibase bug, not in the gadget, because the gadget ignores external-ids which do not need any special handling (line 267). Matěj Suchánek (talk) 09:38, 30 June 2016 (UTC)
@Matěj Suchánek: Sorry to bother, the same issue exists with Theaterlexikon der Schweiz ID (P1362). -- LaddΩ chat ;) 14:27, 30 June 2016 (UTC)
✓ Done Matěj Suchánek (talk) 14:31, 30 June 2016 (UTC)

Special handling for P1793

{{Edit protected}} In P2949, statement formatter URL (P1630) format as a regular expression (P1793) bears value "\D+\-\d+" that incorrectly links to \D+\-\d+ instead of \D+\-\d+. Please add this specific rule in getLinkValueForString():

case 1630 1793: // Format as a regular expression
linkValue = value.replace( '+', '%2b' );
break;

Thanks - -- LaddΩ chat ;) 17:42, 7 July 2016 (UTC)

You propably mean format as a regular expression (P1793). Matěj Suchánek (talk) 20:03, 8 July 2016 (UTC)
@Matěj Suchánek: Gee you're right. Was totally off on that one, thanks for double-checking! -- LaddΩ chat ;) 19:05, 10 July 2016 (UTC)
✓ Done Matěj Suchánek (talk) 19:29, 10 July 2016 (UTC)
@Matěj Suchánek: Testing this change on WikiTree person ID (P2949) failed; it seems it only replaced the first occurrence of "+". I guess the syntax should be corrected to something like linkValue = value.replace( /+/g, '%2b' ); to do a global replacement. The gadget-generated hyperlinks for IMSLP ID (P839) and Theaterlexikon der Schweiz ID (P1362) have similar issues (ex: [4] and [5]), but they nevertheless succeed to open the correct target page. To avoid other issues with these properties or others, I suggest to generalize global replacement to all properties handled by getLinkValueForString().
✓ Done Ok, made global replacements for IMSLP ID (P839), Theaterlexikon der Schweiz ID (P1362) and format as a regular expression (P1793). Matěj Suchánek (talk) 14:18, 11 July 2016 (UTC)
@Matěj Suchánek: Now it no longer does any character replacement for those three properties. I believe quotes are extraneous between the two slashes. Can you please try linkValue = value.replace( /+/g, '%2b' );, without quotes on the search string? thanks -- LaddΩ chat ;) 22:57, 11 July 2016 (UTC)
✓ Done Now it's me who thanks for checking :) (I have added a backslash as '+' is a special character.) Matěj Suchánek (talk) 06:04, 12 July 2016 (UTC)
 Resolved They all work great now! -- LaddΩ chat ;) 00:53, 13 July 2016 (UTC)

Special handling for SIMBAD ID (P3083)

{{Edit protected}} Please, in SIMBAD ID (P3083) let a "+" in the ID not be translated into "%2B", because this results in a not functioning URL. Thank you. Lymantria (talk) 06:22, 14 August 2016 (UTC)

I heavily disagree with doing this. The + is an artifact of a (partial) URL encoding of the identifier. The values should be saved with a space instead of a + (the plus is only used to URL encode spaces there). See also T142972. Cheers, Hoo man (talk) 14:00, 15 August 2016 (UTC)

formatter URL for LEM ID (P920)

The URL for LEM ID (P920) has changed, instead of:

http://id.sgcb.mcu.es/lem/ver/Autoridades/$1/concept

(see archived http://web.archive.org/web/20160303182743/http://id.sgcb.mcu.es/lem/ver/Autoridades/LEM201010931/concept )

is now:

http://id.sgcb.mcu.es/Autoridades/$1/concept.html

For example: http://id.sgcb.mcu.es/Autoridades/LEM201010931/concept.html

Please, could you update the Gadget? Thanks in advance. —surueña 07:29, 18 August 2016 (UTC)

I just noticed that the version of the gadget I saw was an old one, and the message at the top of the page that "The property formatters are no longer stored in the gadget", so forget my request, sorry. —surueña 12:27, 18 August 2016 (UTC)

Fix formatting when EasyQuery is also enabled

{{Editprotected}}

When I have EasyQuery gadget also enabled, then the formatting of links displays duplicate text. (see phab:T143317)

I have figured out a way to fix this:

https://www.wikidata.org/w/index.php?title=User%3AAude%2Fauthority.js&type=revision&diff=366090096&oldid=366065890

Aude (talk) 17:30, 18 August 2016 (UTC)

✓ Done. Sjoerd de Bruin (talk) 16:04, 20 August 2016 (UTC)

RIjksmonumentnummer

Rijksmonumentnummer has changed to https://monumentenregister.cultureelerfgoed.nl/monuments/id --Hannolans (talk) 06:55, 6 October 2016 (UTC)

 Not done You have already changed it at Rijksmonument ID (P359). Matěj Suchánek (talk) 11:24, 6 October 2016 (UTC)
Ah, I didnt expect this actually works automatically here. Good to know! --Hannolans (talk) 12:46, 6 October 2016 (UTC)

Value missing for FIPS 6-4 (P882)

After the page loads, the values for FIPS 6-4 (P882) are removed from the page, all that's left is an external link icon. See Q504397#P882 for example. I assume this is something to do with this gadget since it has special handling for the property. - Nikki (talk) 16:28, 9 October 2016 (UTC)