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

Check whether entry is of type ICacheEntry in Cache->remove() #33050

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Jun 28, 2022

In some scenarios (file not in cache, but partial data of it in the
object), Cache->get() might return an array, which leads to errors like
"Call to a member function getId() on array".

So check whether the returned entry is of type ICacheEntry before doing
operations on it in Cache->remove().

Fixes: #33023

Supersedes: #22598

Signed-off-by: Jonas jonas@freesources.org

@mejo-
Copy link
Member Author

mejo- commented Jun 28, 2022

/backport to stable24

@mejo-
Copy link
Member Author

mejo- commented Jun 28, 2022

/backport to stable23

@mejo-
Copy link
Member Author

mejo- commented Jun 28, 2022

/backport to stable22

@mejo- mejo- force-pushed the fix/cache_partial_array_remove branch from e5e43d4 to 6cca7e5 Compare June 28, 2022 15:31
@mejo-
Copy link
Member Author

mejo- commented Jun 28, 2022

Failed samba tests in CI seem unrelated.

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care 👍

@mejo-
Copy link
Member Author

mejo- commented Jun 29, 2022

/rebase

In some scenarios (file not in cache, but partial data of it in the
object), Cache->get() might return an array, which leads to errors like
"Call to a member function getId() on array".

So check whether the returned entry is of type ICacheEntry before doing
operations on it in Cache->remove().

Fixes: #33023

Signed-off-by: Jonas <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Files/Cache/Cache.php->get() returns partial array, leads to errors
3 participants