Last modified: 2013-10-09 17:23:46 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 T50965, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48965 - time data values are not validated when saved via api
time data values are not validated when saved via api
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
master
All All
: High normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on: 49186 49263 49264
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 10:21 UTC by Aude
Modified: 2013-10-09 17:23 UTC (History)
5 users (show)

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


Attachments

Description Aude 2013-05-30 10:21:30 UTC

    
Comment 1 Aude 2013-05-30 10:23:57 UTC
I am allowed to save in the api (via wbcreateclaim) the following:

datavalue: {
value: {
time: "+00000001936-15-08T00:00:00Z",
timezone: 0,
before: 0,
after: 0,
precision: 11,
calendarmodel: "http://www.wikidata.org/wiki/Q12138"
},
type: "time"

http://www.wikidata.org/wiki/Q12138 is not a valid calendar model.  It should be http://www.wikidata.org/entity/Q1985727.

This should be validated when the claim gets saved and return an error if the data value is not valid.

As it does get saved currently, we then see an error in the UI on an item page in the snak view:

"The value does not comply with the property's definition.
The value's data value type "ununserializable" does not match the property's data type's data value type "time"."
Comment 2 denny vrandecic 2013-05-30 10:28:08 UTC
hmm... yeah, that's a tough one. On the one hand, do we really want to restrict it too much?

I would say that the error message is not too good. It should actually be "The data is saved with an unknown calendar model, to which we do not know how to translate to".

And then the saved data in proleptic gregorian could still be displayed.
Comment 3 Amir Ladsgroup 2013-05-30 11:53:46 UTC
I want to ask if we click on "http://www.wikidata.org/entity/Q1985727" we find error 404 so i think it should changes to something better like "
http://www.wikidata.org/wiki/Q12138" I mean don't remove restrictions, change it!
Comment 4 Aude 2013-05-30 13:24:36 UTC
@amir we have a patch for supporting /entity/QXXX in apache.  It should work soon.

@denny it seems any arbitrary url or string can be put as calendar model.  bots will go astray and have a potential mess.

I think it's best to have validation checked during save, so the api user has a chance to get it "right".  Not sure about hard-coding the calendar models though.  If they could be configurable and more flexible, that would be nice.
Comment 5 Gerrit Notification Bot 2013-06-11 10:20:05 UTC
Related URL: https://gerrit.wikimedia.org/r/67962 (Gerrit Change I6990983ef0c0cad7c9d4f271bdf803902b94230b)
Comment 6 Gerrit Notification Bot 2013-06-12 10:58:56 UTC
Related URL: https://gerrit.wikimedia.org/r/68150 (Gerrit Change I8916062971114d6bc3188dd4f0322c28cc54403e)
Comment 7 Gerrit Notification Bot 2013-06-12 10:59:55 UTC
https://gerrit.wikimedia.org/r/68150 (Gerrit Change I8916062971114d6bc3188dd4f0322c28cc54403e) | change APPROVED and MERGED [by jenkins-bot]
Comment 8 Gerrit Notification Bot 2013-06-12 11:03:40 UTC
https://gerrit.wikimedia.org/r/67962 (Gerrit Change I6990983ef0c0cad7c9d4f271bdf803902b94230b) | change ABANDONED [by Daniel Kinzler]
Comment 9 Gerrit Notification Bot 2013-06-12 11:05:40 UTC
Related URL: https://gerrit.wikimedia.org/r/68152 (Gerrit Change I72d6b6d890718c07006c306c254479ce0789067e)
Comment 10 Gerrit Notification Bot 2013-06-13 14:26:13 UTC
Related URL: https://gerrit.wikimedia.org/r/68397 (Gerrit Change Ib3e7b16c203d08008d7465859af0e1e7f940db14)
Comment 11 Gerrit Notification Bot 2013-06-21 08:57:02 UTC
https://gerrit.wikimedia.org/r/68397 (Gerrit Change Ib3e7b16c203d08008d7465859af0e1e7f940db14) | change ABANDONED [by Daniel Kinzler]
Comment 12 Gerrit Notification Bot 2013-07-25 18:19:45 UTC
Change 68152 merged by jenkins-bot:
(bug 49264, bug 48965) validate time format.

https://gerrit.wikimedia.org/r/68152

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


Navigation
Links