-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Search for prev/next sibling returns Collection #3396
Comments
Yup. I have no idea why it does that, but I did add CC @rhukster |
FYI, I'm already creating a PR for this 😉 |
I don't think it will be accepted as I'm pretty sure there was a reason why I didn't fix that. |
Still created 🙂 Maybe it'll be a jump-start for Grav team to investigate this |
I checked Flex Pages collections and it already has this behavior. Though it's not really being used, but... I must have been thinking about changing the behavior already. |
Yes, elsewhere it's fine. That's why I'm leaning towards fixing page collection too. |
Hi, any progress here? I am facing the same issue as @Karmalakas and it is quite annoying. Is there any correct (simple or straightforward) way to get page siblings? For me, it looks like it is broken, or I am wrong? Or I don't get something important? Edited: Sorry, bad output during debugging - collections and children itself are ok. |
/system/src/Grav/Common/Page/Collection.php::adjacentSibling() may return back the whole Collection if previous or next sibling is not found. All other places in such case expect to return
false
. system/src/Grav/Common/Page/Interfaces/PageCollectionInterface.php::adjacentSibling() defines return typesPageInterface|PageCollectionInterface|false
, butPageCollectionInterface
should not be there as no other method expects to return it. Also naming suggests aPageInterface
if found or empty value (null|false
) to be returned if not found, but not a collectionThe text was updated successfully, but these errors were encountered: