From a906177c2047f8bb62a333d9baf3d5a7b9a7c7c3 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Wed, 25 Sep 2013 22:50:54 +0200 Subject: [PATCH] Clear legacy restriction field on page restriction update 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/WikiPage.php b/includes/WikiPage.php index bfa9956e0c..2265aca3ab 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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") -- 2.20.1