Last modified: 2014-10-28 09:06:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64442, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62442 - in javascript wb.entity does not contain any aliases
in javascript wb.entity does not contain any aliases
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=frontend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-08 21:12 UTC by Bene*
Modified: 2014-10-28 09:06 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bene* 2014-03-08 21:12:00 UTC
Go to <http://wikidata.beta.wmflabs.org/wiki/Q18361>, inspect with firebug the wb.entity object, or try to call wb.entity.getAllAliases(). You won't get any aliases, even if there are some added in your language.
Comment 1 Daniel Kinzler 2014-03-11 16:24:57 UTC
Teh backend does provide the aliases correctly in the wbEntities variable, try mw.config.get('wbEntity'). Must be a problem with how the UI code processes that.
Comment 2 Henning 2014-10-27 15:05:20 UTC
When was there a wb.entity object? Anyway, since we decoupled the concepts of entityview and page, it is not recommended to access global JS objects anymore. An entity object may be retrieved via an entityview, e.g.:
var entiyview = $( ':wikibase-entityview' ).data( 'entityview' ),
  entity = entityview.option( 'value' ); // *
  aliases = entity.getAllAliases(); // **

* Returns the entity object the entityview has been initialized with. In the future, there will be a entityview.value() function which returns the current entity (considering all changes applied to fingerprint, statements, sitelinks without reinitializing the entityview).
** Will change with https://github.com/wmde/WikibaseDataModelJavaScript/pull/16/.
Comment 3 Adrian Lang 2014-10-28 09:06:52 UTC
I removed wb.entity in 1beb1c8fa873fa4c549c703859ee1dc459b92bf7 as part of the effort to remove global state and coupling of page / wb context to a single entity. This should not have affected anything back in march, though.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links