API Remove overriding function getTitle()

In the case that no title is entered in the CMS's title field no title is returned, rather than the CMS widget's title.
This commit is contained in:
Raissa North 2018-02-02 11:13:52 +13:00
parent 0a3c280c3d
commit ab8349209a
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\TextField;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\Versioned\Versioned;
/**
@ -48,11 +49,6 @@ class Widget extends DataObject
private static $default_sort = "\"Sort\"";
/**
* @var string
*/
private static $title = "Widget Title";
/**
* @var string
*/
@ -123,17 +119,6 @@ class Widget extends DataObject
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
*/

View File

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