Last modified: 2008-10-08 21:45:42 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 T17885, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15885 - API outputs old and new protections in different formats
API outputs old and new protections in different formats
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-07 20:29 UTC by Gurch
Modified: 2008-10-08 21:45 UTC (History)
3 users (show)

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


Attachments

Description Gurch 2008-10-07 20:29:28 UTC
When using 'list=logevents&letype=protect' in an API query, protections made more than about a month ago are output in a different format to those made more recently.

See for example http://en.wikipedia.org/w/api.php?action=query&list=logevents&letype=protect&letitle=Paul%20Newman

Any chance the API module can convert the old format to the new, or otherwise output all protection log entries in a consistent format?
Comment 1 Roan Kattouw 2008-10-07 21:16:03 UTC
(In reply to comment #0)
> Any chance the API module can convert the old format to the new, or otherwise
> output all protection log entries in a consistent format?
> 

I can't give a definitive answer until tomorrow, but what I think is happening here is that protection information was only added to log_params recently (about a month ago). If I'm right, this data simply isn't in the logging table for protections predating that change, so the API would naturally be unable to output any information about them.

Of course the second, empty <param /> tag is weird and needs to be fixed.
Comment 2 Roan Kattouw 2008-10-08 15:00:32 UTC
(In reply to comment #1) 
> I can't give a definitive answer until tomorrow, but what I think is happening
> here is that protection information was only added to log_params recently
> (about a month ago). If I'm right, this data simply isn't in the logging table
> for protections predating that change, so the API would naturally be unable to
> output any information about them.
> 
Turns out I was right, so this bug is INVALID.

> Of course the second, empty <param /> tag is weird and needs to be fixed.
> 
The second param tag is there to flag whether cascading protection is used: if it's not, you'll get <param />, if it is, you'll get <param>cascade</param>.

The current display of protect parameters isn't really elegant, but as there's pretty much no useful information in the log_params field (just the part of the summary that lists the protection levels and expiries, and the cascade flag) I'm not going to bother displaying it in a special format like with moves and some other actions: there's simply not enough machine-readable information in log_params to warrant that.

If you care about getting protection types, levels and expiries from the protection log in a machine-readable format, please file another bug here requesting that the format used to store protection information in log_params be changed. As a workaround, you can query current protection status through prop=info&inprop=protections , but that won't get you anywhere if the protection in question has been removed, altered or has expired.
Comment 3 Gurch 2008-10-08 18:43:25 UTC
(In reply to comment #2)
> If you care about getting protection types, levels and expiries from the
> protection log in a machine-readable format, please file another bug here
> requesting that the format used to store protection information in log_params
> be changed. As a workaround, you can query current protection status through
> prop=info&inprop=protections , but that won't get you anywhere if the
> protection in question has been removed, altered or has expired.

It's OK... the current format is adequate, just means a little more complexity getting the protection log (first have to work out whether the old or new format is being used, then parse the "comment" field or <param> tags as appropriate and extract the protection details).
Comment 4 Roan Kattouw 2008-10-08 19:57:14 UTC
(In reply to comment #3)
> It's OK... the current format is adequate, just means a little more complexity
> getting the protection log (first have to work out whether the old or new
> format is being used, then parse the "comment" field or <param> tags as
> appropriate and extract the protection details).
> 

Well the API was invented to eliminate parsing text which may change its format at any time. Since you'd benefit from it, I'll bug people about changing the log_params format so protection data can be presented cleanly.
Comment 5 Gurch 2008-10-08 21:45:42 UTC
(In reply to comment #4)
> Well the API was invented to eliminate parsing text which may change its format
> at any time. Since you'd benefit from it, I'll bug people about changing the
> log_params format so protection data can be presented cleanly.

Thanks... don't worry too much about it though, even that would still mean parsing two formats (as the old protections have the data embedded in the summary field).


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


Navigation
Links