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:
Luke Towers 2017-11-01 14:18:41 -06:00 committed by GitHub
parent 2239f988d2
commit d164145229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;