mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 02:25:05 +00:00
(mvc) regression, fix validation issue on arrayfields children
This commit is contained in:
parent
d26c14a035
commit
6c02d112f8
@ -84,6 +84,7 @@ class ArrayField extends BaseField
|
||||
// initialize field with new internal id and defined default value
|
||||
$node->setInternalReference($container_node->__reference.".".$key);
|
||||
$node->applyDefault();
|
||||
$node->setChanged();
|
||||
$container_node->addChildNode($key, $node);
|
||||
}
|
||||
|
||||
|
||||
@ -256,6 +256,14 @@ abstract class BaseField
|
||||
$this->internalValue = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* force field to act as changed, used after cloning.
|
||||
*/
|
||||
public function setChanged()
|
||||
{
|
||||
$this->internalInitialValue = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if field content has changed
|
||||
* @return bool change indicator
|
||||
@ -452,16 +460,16 @@ abstract class BaseField
|
||||
*/
|
||||
public function setDefault($value)
|
||||
{
|
||||
$this->internalValue = $value;
|
||||
$this->internalDefaultValue = $value;
|
||||
$this->setValue($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* (re)Apply default value
|
||||
* (re)Apply default value without changing the initial value of the field
|
||||
*/
|
||||
public function applyDefault()
|
||||
{
|
||||
$this->setValue($this->internalDefaultValue);
|
||||
$this->internalValue = $this->internalDefaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user