Skip to content

Commit

Permalink
Fix taglist formwidget in relation mode for empty tags (wintercms#1123)
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Towers <[email protected]>
  • Loading branch information
mjauvin and LukeTowers authored May 8, 2024
1 parent 22749b0 commit f8459b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/backend/widgets/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,14 @@ public function getSaveData(bool $includeAllFields = false): array
continue;
}

$widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts, FormField::NO_SAVE_DATA));
// Exclude fields that didn't provide any value
$fieldValue = $this->dataArrayGet($result, $parts, FormField::NO_SAVE_DATA);
if ($fieldValue === FormField::NO_SAVE_DATA) {
continue;
}

// Exclude fields where the widget returns NO_SAVE_DATA
$widgetValue = $widget->getSaveValue($fieldValue);
if ($widgetValue === FormField::NO_SAVE_DATA) {
continue;
}
Expand Down

0 comments on commit f8459b4

Please sign in to comment.