Permalink
Browse files

BUGFIX Fixed FulltextSearchable checking DB::getConn() unncessarily for

MySQL, as Database::requireTable() will only apply create_table_options
to the database adapter they're set for. Replace Object::add_static_var
usage (deprecated) with the new config system instead.
  • Loading branch information...
1 parent 92b6adf commit ec02ab6f68efa15b79a0892de324fc45259a3f98 @halkyon halkyon committed Mar 25, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 search/FulltextSearchable.php
@@ -52,9 +52,7 @@ static function enable($searchableClasses = array('SiteTree', 'File')) {
if(!class_exists($class)) continue;
if(isset($defaultColumns[$class])) {
- if(DB::getConn()->getDatabaseServer() == 'mysql') {
- Object::add_static_var($class, 'create_table_options', array('MySQLDatabase' => 'ENGINE=MyISAM'), true);
- }
+ Config::inst()->update($class, 'create_table_options', array('MySQLDatabase' => 'ENGINE=MyISAM'));
Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')");
} else {
throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'");

0 comments on commit ec02ab6

Please sign in to comment.