From 33066bffda62e813e6f58f5748813c55d68d6be6 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 18 Jan 2009 22:46:16 +0000 Subject: [PATCH] BUGFIX Reverted special cases for Translatable in Versioned->canBeVersioned() (originally committed in r42119) - was checking for existence of underscores in table names as an indication of the "_lang" suffix, which is no longer needed. It was also a flawed assumption which tripped over classes like TranslatableTest_TestPage git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70318 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Versioned.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/core/model/Versioned.php b/core/model/Versioned.php index 1a594ba80..fb5f467ee 100755 --- a/core/model/Versioned.php +++ b/core/model/Versioned.php @@ -329,22 +329,8 @@ class Versioned extends DataObjectDecorator { * @return boolean */ function canBeVersioned($table) { - - $tableParts = explode('_',$table); - $dbFields = singleton($tableParts[0])->databaseFields(); - if (!ClassInfo::exists( $tableParts[0] ) || !is_subclass_of( $tableParts[0], 'DataObject' ) || empty( $dbFields )){ - return false; - } else if (count($tableParts)>1) { - foreach (Versioned::$versionableExtensions as $versionableExtension => $suffixes) { - if ($this->owner->hasExtension($versionableExtension)) { - foreach ((array)$suffixes as $suffix) { - if ($part = array_search($suffix,$tableParts)) unset($tableParts[$part]); - } - } - } - if (count($tableParts)>1) return false; - } - return true; + $dbFields = singleton($table)->databaseFields(); + return !(!ClassInfo::exists($table) || !is_subclass_of($table, 'DataObject' ) || empty( $dbFields )); } /**