inprop=protection lists cascade protections before pre-1.10 protections
Closed, ResolvedPublic

Description

Author: cbm.wikipedia

Description:
If a page is protected via an entry in the page table (instead of the page_restrictions table) and also cascade protected, the API doesn't return protection information about the page itself. This can be seen in the following query, where there are no results without a source= field. The accompanying SQL query shows that the page actually is protected; the user interface verifies en:Template:!! was protected in 2006.

API query demonstrating the problem:

http://en.wikipedia.org/w/api.php?action=query&prop=info&inprop=protection&titles=Template:!!

Results:

<?xml version="1.0" encoding="utf-8"?>
<api>
<query>
<pages>
<page pageid="5994763" ns="10" title="Template:!!" touched="2008-09-05T09:29:45Z" lastrevid="113778948" counter="0" length="65">
<protection>
<pr type="edit" level="sysop" expiry="infinity" source="User:Hersfold/Lockbox" />
<pr type="move" level="sysop" expiry="infinity" source="User:Hersfold/Lockbox" />
</protection>
</page>
</pages>
</query>
</api>

Protection status:

mysql> select * from page left join page_restrictions on page_id = pr_page where page_title = '!!' and page_namespace= 10;
+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+

page_idpage_namespacepage_titlepage_restrictionspage_counterpage_is_redirectpage_is_newpage_randompage_touchedpage_latestpage_lenpr_pagepr_typepr_levelpr_cascadepr_userpr_expirypr_id

+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+

599476310!!edit=sysop:move=sysop0000.1898670448922008090509294511377894865NULLNULLNULLNULLNULLNULLNULL

+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+
1 row in set (0.00 sec)

Desired behavior: return results without a source= field, as this query does:

http://en.wikipedia.org/w/api.php?action=query&prop=info&inprop=protection&titles=Template:*mp


Version: 1.12.x
Severity: normal

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 10:16 PM
bzimport set Reference to bz15535.
bzimport created this task.Via LegacySep 9 2008, 12:42 PM
bzimport added a comment.Via ConduitSep 9 2008, 8:34 PM

cbm.wikipedia wrote:

The query I reported above,

http://en.wikipedia.org/w/api.php?action=query&prop=info&inprop=protection&titles=Template

now returns:

<?xml version="1.0" encoding="utf-8"?>
<api>
<query>
<pages>
<page pageid="237862" ns="0" title="Template" touched="2008-09-06T22:42:09Z" lastrevid="236742124" counter="1" length="2341">
<protection />
</page>
</pages>
</query>
</api>

The page is still protected:

mysql> select * from page left join page_restrictions on page_id = pr_page where page_namespace = 10 and page_title = '!!';
+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+

page_idpage_namespacepage_titlepage_restrictionspage_counterpage_is_redirectpage_is_newpage_randompage_touchedpage_latestpage_lenpr_pagepr_typepr_levelpr_cascadepr_userpr_expirypr_id

+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+

599476310!!edit=sysop:move=sysop0000.1898670448922008090509294511377894865NULLNULLNULLNULLNULLNULLNULL

+---------+----------------+------------+-----------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+---------+---------+----------+------------+---------+-----------+-------+
1 row in set (0.00 sec)

And the page is still cascade protected, according to the enwiki user interface.

Catrope added a comment.Via ConduitSep 9 2008, 8:36 PM

(In reply to comment #1)

The query I reported above,

http://en.wikipedia.org/w/api.php?action=query&prop=info&inprop=protection&titles=Template

Specifying the right title ([[Template:!!]] as opposed to [[Template]]) helps.

bzimport added a comment.Via ConduitSep 9 2008, 8:41 PM

cbm.wikipedia wrote:

Sorry about that; didn't realize bugzilla trims !! off the link. I'm embarrassed.

Catrope added a comment.Via ConduitSep 9 2008, 8:42 PM

Fixed in r40678.

Add Comment