Clear legacy restriction field on page restriction update
authorMarius Hoch <hoo@online.de>
Wed, 25 Sep 2013 20:50:54 +0000 (22:50 +0200)
committerMarius Hoch <hoo@online.de>
Wed, 25 Sep 2013 20:50:54 +0000 (22:50 +0200)
This causes problems where some pages can't be unprotected
as we still take the legacy field into account. See also
bug 33334.

Change-Id: Ibaec827289b1070ee110635d6c9d7b60e061384b

includes/WikiPage.php

index bfa9956..2265aca 100644 (file)
@@ -2347,6 +2347,14 @@ class WikiPage implements Page, IDBAccessObject {
                                }
                        }
 
+                       // Clear out legacy restriction fields
+                       $dbw->update(
+                               'page',
+                               array( 'page_restrictions' => '' ),
+                               array( 'page_id' => $id ),
+                               __METHOD__
+                       );
+
                        wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $nullRevision, $latest, $user ) );
                        wfRunHooks( 'ArticleProtectComplete', array( &$this, &$user, $limit, $reason ) );
                } else { // Protection of non-existing page (also known as "title protection")