mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
mvc: make getCurrentValue() never return null; closes #8195
This commit is contained in:
parent
be42113aa5
commit
03bd82881f
@ -360,14 +360,14 @@ abstract class BaseField
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getCurrentValue() ?? '';
|
||||
return $this->getCurrentValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* return field current value
|
||||
* @return null|string field current value
|
||||
*/
|
||||
public function getCurrentValue(): ?string
|
||||
public function getCurrentValue(): string
|
||||
{
|
||||
return (string)$this->internalValue;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ class LinkAddressField extends BaseField
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
$value = $this->getCurrentValue() ?? '';
|
||||
$value = $this->getCurrentValue();
|
||||
|
||||
if (isset(self::$known_addresses[$value])) {
|
||||
return self::$known_addresses[$value];
|
||||
@ -124,7 +124,7 @@ class LinkAddressField extends BaseField
|
||||
/**
|
||||
* return either ipaddr or if field, only one should be used, addresses are preferred.
|
||||
*/
|
||||
public function getCurrentValue(): ?string
|
||||
public function getCurrentValue(): string
|
||||
{
|
||||
$parent = $this->getParentNode();
|
||||
|
||||
@ -134,7 +134,7 @@ class LinkAddressField extends BaseField
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user