Merge pull request #164 from creative-commoners/pulls/2.0/return-null-for-empty-null

API Remove overriding function getTitle()
This commit is contained in:
Robbie Averill 2018-02-02 11:53:16 +13:00 committed by GitHub
commit 76b8b3f891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 17 deletions

View File

@ -11,6 +11,7 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\HiddenField;
use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextField;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\Versioned;
/** /**
@ -48,11 +49,6 @@ class Widget extends DataObject
private static $default_sort = "\"Sort\""; private static $default_sort = "\"Sort\"";
/**
* @var string
*/
private static $title = "Widget Title";
/** /**
* @var string * @var string
*/ */
@ -123,17 +119,6 @@ class Widget extends DataObject
return $this->renderWith(array_reverse(ClassInfo::ancestry(__CLASS__))); return $this->renderWith(array_reverse(ClassInfo::ancestry(__CLASS__)));
} }
/**
* Get the frontend title for this widget
*
* @return string
*/
public function getTitle()
{
return $this->getField('Title')
?: _t(__CLASS__ . '.TITLE', $this->config()->get('title'));
}
/** /**
* @return string * @return string
*/ */

View File

@ -9,6 +9,5 @@ class TestWidget extends Widget implements TestOnly
{ {
private static $table_name = 'WidgetAreaEditorTest_TestWidget'; private static $table_name = 'WidgetAreaEditorTest_TestWidget';
private static $cmsTitle = "Test widget"; private static $cmsTitle = "Test widget";
private static $title = "Test widget";
private static $description = "Test widget"; private static $description = "Test widget";
} }