mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
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:
parent
0a3c280c3d
commit
ab8349209a
@ -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
|
||||
*/
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user