Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TagList formwidget #1267

Merged
merged 9 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
fix empty taglist in relation mode
mjauvin committed Dec 6, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 68c3af8b60657517bb9b6b1080a30223afbe4971
4 changes: 4 additions & 0 deletions modules/backend/widgets/Form.php
Original file line number Diff line number Diff line change
@@ -1227,6 +1227,10 @@ public function getSaveData(): array
// Exclude fields that didn't provide any value
$fieldValue = $this->dataArrayGet($result, $parts, FormField::NO_SAVE_DATA);
if ($fieldValue === FormField::NO_SAVE_DATA) {
if ($widget->getConfig('type') === 'taglist' && $widget->getConfig('mode') === 'relation') {
// let the TagList remove its relation items
$widget->getSaveValue(array());
}
continue;
}