mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX HeaderField requires the optional Title field
FormField marks the Title constructor argument as optional, and DatalessField does not override the __construct method. HeaderField on the other hand goes against the grain of FormFields as a whole and requires the Title field, seemingly for no good reason (at least, not that the commit message for a68ba38478
indicates) - this seems like an accidental ommision. This commit looks to reinstate the optionality of this constructor argument for consistency's sake.
Plus it broke a module I was investigating.
This commit is contained in:
parent
8b4b54f264
commit
25aa3af032
@ -30,7 +30,7 @@ class HeaderField extends DatalessField
|
||||
* @param string $title
|
||||
* @param int $headingLevel
|
||||
*/
|
||||
public function __construct($name, $title, $headingLevel = 2)
|
||||
public function __construct($name, $title = null, $headingLevel = 2)
|
||||
{
|
||||
$this->setHeadingLevel($headingLevel);
|
||||
parent::__construct($name, $title);
|
||||
|
Loading…
Reference in New Issue
Block a user