mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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.
This commit is contained in:
parent
92b6adfcb5
commit
ec02ab6f68
@ -52,9 +52,7 @@ class FulltextSearchable extends DataExtension {
|
|||||||
if(!class_exists($class)) continue;
|
if(!class_exists($class)) continue;
|
||||||
|
|
||||||
if(isset($defaultColumns[$class])) {
|
if(isset($defaultColumns[$class])) {
|
||||||
if(DB::getConn()->getDatabaseServer() == 'mysql') {
|
Config::inst()->update($class, 'create_table_options', array('MySQLDatabase' => 'ENGINE=MyISAM'));
|
||||||
Object::add_static_var($class, 'create_table_options', array('MySQLDatabase' => 'ENGINE=MyISAM'), true);
|
|
||||||
}
|
|
||||||
Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')");
|
Object::add_extension($class, "FulltextSearchable('{$defaultColumns[$class]}')");
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'");
|
throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '$class'");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user