Last modified: 2011-08-18 19:27:22 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 T32395, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30395 - Date type does not handle a sole year value correctly
Date type does not handle a sole year value correctly
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticDrilldown (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-16 11:15 UTC by Gavin O'Gorman
Modified: 2011-08-18 19:27 UTC (History)
2 users (show)

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


Attachments
example of date parsing error (309.96 KB, image/jpeg)
2011-08-16 11:24 UTC, Gavin O'Gorman
Details

Description Gavin O'Gorman 2011-08-16 11:15:53 UTC
If a property of type::Date (submittedOn for example) is created and then assigned a single value of a single year e.g:

[[submittedOn::2011]] 

then the value is not parsed correctly. The problem is in datavalues/SMW_DV_Time.php:149 and is the MediaWiki wfTimestamp() function. It doesn't correctly parse the year, but returns a value anyway. I did a quick test:

if ( $timeStamp !== false && $timeStamp != 19700101003332 ) {

and that fixed the problem. Obviously it's not a good solution, the wfTimestamp function probably needs to be fixed.
Comment 1 Gavin O'Gorman 2011-08-16 11:24:00 UTC
Created attachment 8925 [details]
example of date parsing error
Comment 2 Jeroen De Dauw 2011-08-18 19:27:22 UTC
Should be fixed by r94928. The solution still isn't ideal, but it should do the job. Can you confirm it works for you?

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


Navigation
Links