Page MenuHomePhabricator

It should be possible to enter expiry dates for edit and move protection separately
Closed, ResolvedPublic


Author: matthew.britton

To prevent screw-ups such as this one:

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:02 PM
bzimport set Reference to bz12650.

This is possible database-wise, the UI should just have two Expiry input boxes.

lunasantin wrote:

Not quite duplicates, but I think Bug 10079 might handle this problem more completely. Aside from protection expiry removing old move-protection, it can also remove old semi-protection (suppose a contentious page has long been under semi, to deal with vandalism, and is temporarily given fullprot, to stop an edit war; should the vandals be let back in, when protection expires?).

flyguy649 wrote:

This would also be useful for pages that are permanently move protected, like WP:ANI, that require short-term semi-protection because of IP vandalism.

random832 wrote:

Is it possible to fully protect with an expiration and have it expire to semi-protection?

(re: expiring from one level to a lower level of protection) Not at this time, though that might indeed be handy.

Created attachment 5210

Adds an expiry input for each protection type, as noted, the database already supports this. $mRestrictionsExpiry in Title.php and $mExpiry in ProtectionForm are now arrays with the action as keys. If any extension uses these it could potentially break it.

The only outstanding problem is cascading protection. If one protection expires before the other, the page will be left with partial cascading protection (move-only cascading protection). I can think of a few possible solutions for this, not sure which is most desirable:

  1. Leave as is.
  1. Require all the expiration times to be the same when using cascading protection.
  1. Add a pr_cascade_expiry field to the page_restrictions table set to the shortest single expiry time, to have cascading protection expire when the first protection level expires.
  1. Only apply the cascading protection to the database row where pr_type = 'edit', and have the cascading protection functions loop over $wgRestrictionTypes when applying restrictions.

attachment 12650.patch ignored as obsolete

Created attachment 5211

Same as previous patch, some code cleanup and docs in protect.js. Everything in previous comment still applies.


If you made only the 'edit' restriction level row have pr_cascade = 1, I would still cascade to pages that use it without any new iterations.

Should be fixed in r40601 if auto-reviewing is on. Use of rev_timestamp can more so should deal with any other issues.

(In reply to comment #9)

Should be fixed in r40601 if auto-reviewing is on. Use of rev_timestamp can
more so should deal with any other issues.

Bah, wrong bug :)