Skip to content

Commit

Permalink
remove empty item for all modes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 20, 2024
1 parent 20a73ff commit d7d1993
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/backend/formwidgets/TagList.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public function prepareVars()
*/
public function getSaveValue($value)
{
if (is_array($value)) {
$value = array_filter($value);
}

if ($this->mode === static::MODE_RELATION) {
return $this->hydrateRelationSaveValue($value);
}
Expand All @@ -131,8 +135,6 @@ protected function hydrateRelationSaveValue($names): ?array
$names = [$names];
}

$names = array_filter($names);

$relation = $this->getRelationObject();
$relationModel = $this->getRelationModel();

Expand Down

0 comments on commit d7d1993

Please sign in to comment.