Last modified: 2007-11-02 11:32:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11772 - Properties don't display using specified unit synonyms
Properties don't display using specified unit synonyms
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Markus Krötzsch
http://ontoworld.org/wiki/Panasonic_R5
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-27 04:48 UTC by S Page
Modified: 2007-11-02 11:32 UTC (History)
0 users

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


Attachments
partial fix (1.18 KB, patch)
2007-10-27 05:34 UTC, S Page
Details
better fix (2.33 KB, patch)
2007-10-27 05:45 UTC, S Page
Details

Description S Page 2007-10-27 04:48:29 UTC
A Type page can list multiple synonyms for each "converts to" unit.  A property can then say it wants to display any synonym for a unit, e.g. [[Display units::",centimetres]] instead of in, cm.

But in 1.0 the property's value in the factbox will use the first unit for each kind of unit from the datatype's Type: page, not the synonym you specify.  So you see
 10.4 in (26.416 cm)
instead of the
 10.4 " (26.416 centimetres)
you requested.

This is a regression from 0.7 (hence I'm marking this bug high priority); the factbox in 0.7 displays attribute values using whatever synonym for a unit you specify.

Similarly, the tooltip in the main text that displays the conversion to alternate units also uses the first unit.  You see 26.416 cm in the tooltip, not the "26.416 centimetres" you requested.  This also is a regression from 0.7

Similarly, the property page's list of values also uses the first unit, not the synonym you specify.  This is not a regression, since in 0.7 the list of values on the property page ignored preferred units altogether.
Comment 1 S Page 2007-10-27 05:34:30 UTC
Created attachment 4278 [details]
partial fix

This patch fixes the factbox display and tooltip display to use the unit synonyms requested, but breaks the list of properties on the Property page ;-(
Comment 2 S Page 2007-10-27 05:35:27 UTC
In SMW_DV_Linear.php's initDisplayData, each unit from SMW_SP_DISPLAY_UNITS is replaced with the canonical unit in m_unitids to come up with m_displayunits.  But the code needs to remember the synonym(s) that the property wants.  And then elsewhere the code needs to determine the canonical unit to get conversion factors, but not overwrite $unit with it
Comment 3 S Page 2007-10-27 05:45:05 UTC
Created attachment 4279 [details]
better fix

This patch seems to work on individual pages and the property list.  I'm not sure if it makes other cases (no preferred units, etc.) better or worse.  Hope you find it useful.

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


Navigation
Links