edwardspec / mediawiki-moderation

Extension:Moderation is a powerful anti-spam extension for MediaWiki CMS. It protects small/medium wikis against vandalism by sending all edits/uploads from new users to moderation.
https://mediawiki.org/wiki/Extension:Moderation
GNU General Public License v3.0
30 stars 22 forks source link

Installation Error : 'mod_tags' can't have a default value #56

Closed eelitlauree closed 4 years ago

eelitlauree commented 4 years ago

Hi there,

I am trying to install moderation with mediawiki 1.34.2. However, when I run the mediawiki web updater. The following error raised. I using use mysql:5.7. You may find my setup from my repo mediwiki.

Creating moderation table ...
An error occurred:
A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: CREATE TABLE `moderation` (
 mod_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 mod_timestamp varbinary(14) NOT NULL DEFAULT '',
 mod_user int unsigned NOT NULL default 0,
 mod_user_text varchar(255) binary NOT NULL,
 mod_cur_id int unsigned NOT NULL, -- page to be edited
 mod_namespace int NOT NULL default 0,
 mod_title varchar(255) binary NOT NULL default '',
 mod_comment varchar(255) binary NOT NULL default '',
 mod_minor tinyint unsigned NOT NULL default 0,
 mod_bot tinyint unsigned NOT NULL default 0,
 mod_new tinyint unsigned NOT NULL default 0,
 mod_last_oldid int unsigned NOT NULL default 0,
 mod_ip varbinary(40) NOT NULL default '', -- IP address
 mod_old_len int, -- Length of mod_last_oldid revision
 mod_new_len int, -- Length of this proposed (not moderated) revision
 mod_header_xff varbinary(255) NULL default '', -- contents of 'X-Forwarded-For' request header
 mod_header_ua varbinary(255) NULL default '', -- contents of 'User-Agent' request header
 mod_tags blob NULL default '',  -- \n-separated list of ChangeTags (tags assigned by AbuseFilter, etc.)
 mod_preload_id varchar(256) binary NOT NULL,
 mod_rejected tinyint NOT NULL default 0, -- Set to 1 if rejected
 mod_rejected_by_user int unsigned NOT NULL default 0, -- Moderator's user ID
 mod_rejected_by_user_text varchar(255) binary DEFAULT NULL, -- Moderator's username
 mod_rejected_batch tinyint NOT NULL default 0, -- Set to 1 if "reject all edits by this user" button was used
 mod_rejected_auto tinyint NOT NULL default 0, -- Set to 1 if this user was marked with "reject all future edits from this user"
 mod_preloadable int unsigned NOT NULL default 0,
 mod_conflict tinyint NOT NULL default 0, -- Set to 1 if moderator tried to approve this, but "needs manual merging" error occured
 mod_merged_revid int unsigned NOT NULL default 0, -- If not 0, moderator has already merged this, and this is the revision number of the result.
 mod_text MEDIUMBLOB, -- Resulting text of proposed edit
 mod_stash_key varchar(255) DEFAULT NULL, -- If this edit is image upload, contains stash key. NULL for normal edits.
 mod_type varchar(16) binary not null default 'edit',
 mod_page2_namespace int NOT NULL default 0,
 mod_page2_title varchar(255) binary NOT NULL default ''
 ) ENGINE=InnoDB, DEFAULT CHARSET=binary

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/extensions/Moderation/hooks/../sql/patch-moderation.sql )
Error: 1101 BLOB, TEXT, GEOMETRY or JSON column 'mod_tags' can't have a default value (database)

Thanks, Reeve

edwardspec commented 4 years ago

Fixed in 1.5.27.

eelitlauree commented 4 years ago

Hi Edward,

Thank you for the prompt response response. After updating, I can run the db update script. But the updater still failed with this error.

Creating moderation table ...done.
Creating moderation_block table ...done.
...have mod_tags field in moderation table.
Modifying mod_title field of table moderation ...done.
...have mod_type field in moderation table.

An error occurred:
No such service: Moderation.VersionCheck

Do you have any clue on that?

Regards, Reeve

edwardspec commented 4 years ago
An error occurred:
No such service: Moderation.VersionCheck

This is very strange, will investigate this shortly.

edwardspec commented 4 years ago

This is a bug in MediaWiki core. It breaks web updater for all extensions that use Services (not just Moderation). I have filed a bug report with all the details: https://phabricator.wikimedia.org/T258159

For now you can run update.php from the console (only the web updater is affected by this issue).

edwardspec commented 4 years ago

Fixed in 1.5.28.