Skip to content

IBX-8638: Ensured last ancestor is valid before comparing paths in TrashItemData #1598

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4230,12 +4230,6 @@ parameters:
count: 1
path: src/lib/Form/Data/Section/SectionUpdateData.php

-
message: '#^Cannot access property \$path on Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|false\.$#'
identifier: property.nonObject
count: 1
path: src/lib/Form/Data/TrashItemData.php

-
message: '#^Method Ibexa\\AdminUi\\Form\\Data\\URLWildcard\\URLWildcardDeleteData\:\:__construct\(\) has parameter \$urlWildcardsChoices with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Form/Data/TrashItemData.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function isParentInTrash(): bool
{
$lastAncestor = end($this->ancestors);

return $this->location->path !== array_merge($lastAncestor->path, [(string)$this->location->id]);
return $lastAncestor !== false && $this->location->path !== array_merge($lastAncestor->path, [(string)$this->location->id]);
}

public function getCreator(): ?User
Expand Down
Loading