Skip to content

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 [email protected]

@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 <[email protected]>
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

4 participants