r46504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46503‎ | r46504 | r46505 >
Date:00:37, 29 January 2009
Author:werdna
Status:resolved (Comments)
Tags:
Comment:
Fix for r46500 -- use the hook so it actually works.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.php
@@ -55,6 +55,7 @@
5656 $wgHooks['AbortDeleteQueueNominate'][] = 'AbuseFilterHooks::onAbortDeleteQueueNominate';
5757 $wgHooks['RecentChange_save'][] = 'AbuseFilterHooks::onRecentChangeSave';
5858 $wgHooks['ListDefinedTags'][] = 'AbuseFilterHooks::onListDefinedTags';
 59+$wgHooks['LoadExtensionSchemaUpdates'][] = 'AbuseFilterHooks::onLoadExtensionSchemaUpdates';
5960
6061 $wgAvailableRights[] = 'abusefilter-modify';
6162 $wgAvailableRights[] = 'abusefilter-log-detail';
@@ -84,14 +85,6 @@
8586 $wgAjaxExportList[] = 'AbuseFilter::ajaxReAutoconfirm';
8687 $wgAjaxExportList[] = 'AbuseFilter::ajaxGetFilter';
8788
88 -// DB updates
89 -$wgExtNewTables[] = array( 'abuse_filter', "$dir/abusefilter.tables.sql" );
90 -$wgExtNewTables[] = array( 'abuse_filter_history', "$dir/db_patches/patch-abuse_filter_history.sql" );
91 -
92 -$wgExtNewFields[] = array( 'abuse_filter_history', 'afh_changed_fields', "$dir/db_patches/patch-afh_changed_fields.sql" );
93 -$wgExtNewFields[] = array( 'abuse_filter', 'af_deleted', "$dir/db_patches/patch-af_deleted.sql" );
94 -$wgExtNewFields[] = array( 'abuse_filter', 'af_actions', "$dir/db_patches/patch-af_actions.sql" );
95 -
9689 // Bump the version number every time you change any of the .css/.js files
9790 $wgAbuseFilterStyleVersion = 3;
9891
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -165,4 +165,18 @@
166166
167167 return true;
168168 }
 169+
 170+ public static function onLoadExtensionSchemaUpdates() {
 171+ global $wgExtNewTables, $wgExtNewFields;
 172+
 173+ // DB updates
 174+ $wgExtNewTables[] = array( 'abuse_filter', "$dir/abusefilter.tables.sql" );
 175+ $wgExtNewTables[] = array( 'abuse_filter_history', "$dir/db_patches/patch-abuse_filter_history.sql" );
 176+
 177+ $wgExtNewFields[] = array( 'abuse_filter_history', 'afh_changed_fields', "$dir/db_patches/patch-afh_changed_fields.sql" );
 178+ $wgExtNewFields[] = array( 'abuse_filter', 'af_deleted', "$dir/db_patches/patch-af_deleted.sql" );
 179+ $wgExtNewFields[] = array( 'abuse_filter', 'af_actions', "$dir/db_patches/patch-af_actions.sql" );
 180+
 181+ return true;
 182+ }
169183 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46500TSopenldap: build 64-bit libraries; don't package .la and .a files; split dev...river00:06, 29 January 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   21:49, 2 February 2009

Where is $dir defined?

#Comment by Werdna (talk | contribs)   22:05, 2 February 2009

It's been fixed in a later revision.

Status & tagging log