mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes #2613
This fixes #2613 by reloading the form widgets with the modified data after `model.filterFields`. **NOTE**: `$this->processExistingItems()` isn't simply just moved to `prepareVars()` because that messes up the adding new repeater item functionality by repeating the content from the fields for the last item in that group that already exists on the repeater.
This commit is contained in:
parent
2239f988d2
commit
d164145229
@ -120,6 +120,12 @@ class Repeater extends FormWidgetBase
|
||||
*/
|
||||
public function prepareVars()
|
||||
{
|
||||
// Refresh the loaded data to support being modified by filterFields
|
||||
// @see https://github.com/octobercms/october/issues/2613
|
||||
if (!self::$onAddItemCalled) {
|
||||
$this->processExistingItems();
|
||||
}
|
||||
|
||||
if ($this->previewMode) {
|
||||
foreach ($this->formWidgets as $widget) {
|
||||
$widget->previewMode = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user