Last modified: 2012-08-04 20:48:42 UTC
When trying to protect a non-existent page mediawiki throws an error: === Notice: Undefined index: edit in /home/wiki/includes/ProtectionForm.php on line 189 Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "pt_user" of relation "protected_titles" does not exist LINE 1: ...ce,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt... ^ in /home/wiki/includes/DatabasePostgres.php on line 542 === Further Exception handling: === A database error has occurred Query: INSERT INTO protected_titles (pt_namespace,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt_reason) VALUES ('0','Doesnt_Exist','sysop','2008-01-20 19:34:49 GMT','infinity','1','') Function: Title::updateTitleProtection Error: 1 ERROR: column "pt_user" of relation "protected_titles" does not exist LINE 1: ...ce,pt_title,pt_create_perm,pt_timestamp,pt_expiry,pt_user,pt... ^ Backtrace: #0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR: column ...', 1, 'INSERT INTO pro...', 'Title::updateTi...', false) #1 /home/wiki/includes/DatabasePostgres.php(873): Database->query('INSERT INTO pro...', 'Title::updateTi...') #2 /home/wiki/includes/Title.php(1309): DatabasePostgres->replace('protected_title...', Array, Array, 'Title::updateTi...') #3 /home/wiki/includes/ProtectionForm.php(198): Title->updateTitleProtection('sysop', '', 'infinity') #4 /home/wiki/includes/ProtectionForm.php(84): ProtectionForm->save() #5 /home/wiki/includes/Article.php(1680): ProtectionForm->execute() #6 /home/wiki/includes/Wiki.php(404): Article->protect() #7 /home/wiki/includes/Wiki.php(48): MediaWiki->performAction(Object(StubObject), Object(Article), Object(Title), Object(User), Object(WebRequest)) #8 /home/wiki/index.php(89): MediaWiki->initialize(Object(Title), Object(StubObject), Object(User), Object(WebRequest)) #9 {main} === This might be related to not having a correct Database, and if so then this would depend on bug 12714
grep'ing through the patch files there isn't a updater that alters the protected_titles table to add in the pt_user column, the only script is one to create the table.
Between revision 28541 and revision 28574, it appears the table for protected_titles was changed: == - pt_by INTEGER NOT NULL, - pt_reason TEXT, + pt_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, + pt_reason TEXT NULL, == If people had installed version between 28541 and 28574, their table would be incorrect and would throw the above error as the updater only checks to see if the table exists and not if it has the correct schema. So new SVN installs or people updating from 1.11 should not be affected. I'll change this to minor, correct me if I'm wrong.
(In reply to comment #2) > Between revision 28541 and revision 28574, it appears the table for > protected_titles was changed: > > == > - pt_by INTEGER NOT NULL, > - pt_reason TEXT, > + pt_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE > SET NULL, > + pt_reason TEXT NULL, > == > > If people had installed version between 28541 and 28574, their table would be > incorrect and would throw the above error as the updater only checks to see if > the table exists and not if it has the correct schema. > > So new SVN installs or people updating from 1.11 should not be affected. I'll > change this to minor, correct me if I'm wrong. > OK, this is a matter of just fixing it on individual installs that used unsupported developmental trunk versions of the software. Works fine now.