From 2ddb78e6f42c58ac44637f555aef06b9d588c913 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 30 Apr 2013 00:53:22 +0200 Subject: [PATCH] Disabled TestTagFieldPage and TestTag classes Due to changed class parsing in 3.1, the class_exists() checks are no longer recognized, leading to errors when the class is only condtionally autoloaded (or the tagfield isn't present) --- code/tagfield/TestTag.php | 46 ++++++++++---------- code/tagfield/TestTagFieldPage.php | 70 +++++++++++++++--------------- 2 files changed, 56 insertions(+), 60 deletions(-) diff --git a/code/tagfield/TestTag.php b/code/tagfield/TestTag.php index 0d3ae2c..c77d423 100644 --- a/code/tagfield/TestTag.php +++ b/code/tagfield/TestTag.php @@ -1,25 +1,23 @@ 'Text' - ); - - private static $belongs_many_many = array( - 'Pages' => 'TestTagFieldPage' - ); - - function requireDefaultRecords(){ - $class = $this->class; - if(!DataObject::get_one($class)) { - foreach(array('one', 'two', 'three', 'four') as $title) { - $tag = new $class(); - $tag->Title = $title; - $tag->write(); - } - - } - } - } -} \ No newline at end of file +// class TestTag extends DataObject { + +// private static $db = array( +// 'Title' => 'Text' +// ); + +// private static $belongs_many_many = array( +// 'Pages' => 'TestTagFieldPage' +// ); + +// function requireDefaultRecords(){ +// $class = $this->class; +// if(!DataObject::get_one($class)) { +// foreach(array('one', 'two', 'three', 'four') as $title) { +// $tag = new $class(); +// $tag->Title = $title; +// $tag->write(); +// } + +// } +// } +// } \ No newline at end of file diff --git a/code/tagfield/TestTagFieldPage.php b/code/tagfield/TestTagFieldPage.php index b8d39aa..bfa8f08 100644 --- a/code/tagfield/TestTagFieldPage.php +++ b/code/tagfield/TestTagFieldPage.php @@ -1,42 +1,40 @@ 'Text', +// 'FixedTags' => 'Text' +// ); + +// private static $many_many = array( +// 'TestTags' => 'TestTag', +// ); + +// function getCMSFields() { +// $fields = parent::getCMSFields(); - private static $db = array( - 'TestTagString' => 'Text', - 'FixedTags' => 'Text' - ); +// $tf1 = new TagField('TestTagString', "Single column tags (try 'one', 'two', 'three', 'four')", null, 'TestTagFieldPage'); +// $fields->addFieldToTab('Root.Main', $tf1); - private static $many_many = array( - 'TestTags' => 'TestTag', - ); +// $tf2 = new TagField('TestTags', "Relation tags (try 'one', 'two', 'three', 'four')"); +// $fields->addFieldToTab('Root.Main', $tf2); - function getCMSFields() { - $fields = parent::getCMSFields(); - - $tf1 = new TagField('TestTagString', "Single column tags (try 'one', 'two', 'three', 'four')", null, 'TestTagFieldPage'); - $fields->addFieldToTab('Root.Main', $tf1); - - $tf2 = new TagField('TestTags', "Relation tags (try 'one', 'two', 'three', 'four')"); - $fields->addFieldToTab('Root.Main', $tf2); - - $tf3 = new TagField('FixedTags', "Fixed tags (try 'PHP', 'Ruby', 'Python')", null, 'TestTag'); - $tf3->setCustomTags(array('PHP', 'Ruby', 'Python')); - $fields->addFieldToTab('Root.Main', $tf3); - - return $fields; - } +// $tf3 = new TagField('FixedTags', "Fixed tags (try 'PHP', 'Ruby', 'Python')", null, 'TestTag'); +// $tf3->setCustomTags(array('PHP', 'Ruby', 'Python')); +// $fields->addFieldToTab('Root.Main', $tf3); - function requireDefaultRecords(){ - $class = $this->class; - if(!DataObject::get_one($class)) { - $page = new $class(); - $page->Title = "Test TagField"; - $page->write(); - } - } - - } +// return $fields; +// } + +// function requireDefaultRecords(){ +// $class = $this->class; +// if(!DataObject::get_one($class)) { +// $page = new $class(); +// $page->Title = "Test TagField"; +// $page->write(); +// } +// } + +// } - class TestTagFieldPage_Controller extends Page_Controller {} -} \ No newline at end of file +// class TestTagFieldPage_Controller extends Page_Controller {} \ No newline at end of file