diff --git a/.changelog/current/2500-fix-accedd-to-unknown-id.md b/.changelog/current/2500-fix-accedd-to-unknown-id.md new file mode 100644 index 000000000..10b6dc266 --- /dev/null +++ b/.changelog/current/2500-fix-accedd-to-unknown-id.md @@ -0,0 +1,3 @@ +# Fixed + +- Do not access unknown ID of recipe while importing diff --git a/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php b/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php index f085617ab..7527db781 100644 --- a/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php +++ b/lib/Helper/Filter/JSON/RecipeIdTypeFilter.php @@ -10,7 +10,9 @@ class RecipeIdTypeFilter extends AbstractJSONFilter { public function apply(array &$json): bool { $copy = $json; - $json['id'] = strval($json['id']); + if(array_key_exists('id', $json)) { + $json['id'] = strval($json['id']); + } return $json !== $copy; } }