Skip to content

Commit

Permalink
Merge branch 'master' into feature/chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat authored Feb 9, 2024
2 parents 5521ae6 + 2e032ca commit d6408ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 5.0.4
- Fix chunked upload `$type` and `$id` [@life-style-de](https://github.com/dachcom-digital/pimcore-formbuilder/pull/430)
- Add Additional HrefTransformer validation for `$type` and `$id` [@patkul0](https://github.com/dachcom-digital/pimcore-formbuilder/pull/434)

## 5.0.3
- Fix element type check in api channel [#423](https://github.com/dachcom-digital/pimcore-formbuilder/issues/423)
Expand Down
6 changes: 5 additions & 1 deletion src/Transformer/HrefTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ public function reverseTransform(mixed $values, $optionConfig = null): array
$type = $value['type'];
$id = $value['id'];

if (empty($id) || !in_array($type, ['object', 'asset', 'document'])) {
continue;
}

if (is_numeric($id)) {
$element = Service::getElementById($type, $id);
$element = Service::getElementById($type, (int) $id);
} else {
// legacy
$element = Service::getElementByPath($type, $id);
Expand Down

0 comments on commit d6408ef

Please sign in to comment.