-
Notifications
You must be signed in to change notification settings - Fork 48
Do not mutate Field::default/system property in scope condition #662
Copy link
Copy link
Open
Description
and related code:
data/src/Model/Scope/Condition.php
Lines 101 to 115 in 2f89724
| // if we have a definitive scalar value for a field | |
| // sets it as default value for field and locks it | |
| // new records will automatically get this value assigned for the field | |
| // @todo: consider this when condition is part of OR scope | |
| if ($this->operator === '=' && !is_object($this->value) && !is_array($this->value)) { | |
| // key containing '/' means chained references and it is handled in toQueryArguments method | |
| if (is_string($field = $this->key) && !str_contains($field, '/')) { | |
| $field = $model->getField($field); | |
| } | |
| if ($field instanceof Field) { | |
| $field->system = true; | |
| $field->default = $this->value; | |
| } | |
| } |
Reactions are currently unavailable