Skip to content

[6.x] Fix updateChildPageUris empty check never short-circuiting#14547

Merged
jasonvarga merged 1 commit into6.xfrom
update-child-page-uris
Apr 24, 2026
Merged

[6.x] Fix updateChildPageUris empty check never short-circuiting#14547
jasonvarga merged 1 commit into6.xfrom
update-child-page-uris

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

This pull request fixes an issue where saving a structured entry would rewrite URIs for every entry in the collection, even when the entry has no child pages.

This was happening because empty() was being used to check if the flattenedPages collection was empty. Since empty() on a Collection object always returns false (it's a non-null object), the early return never triggered. This meant updateEntryUris was called with an empty Collection, and in the eloquent driver, the whereIn filter was skipped — causing every entry's URI to be recomputed.

This PR fixes it by using the Collection's isEmpty() method instead of empty().

Fixes #14546

@jasonvarga jasonvarga merged commit 6abb6d6 into 6.x Apr 24, 2026
18 checks passed
@jasonvarga jasonvarga deleted the update-child-page-uris branch April 24, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entry::updateChildPageUris() empty($ids) check never short-circuits → every structured-entry save rewrites URIs for the entire collection

2 participants