Skip to content

fix: LazyCollection regression fixes#7952

Merged
lukasbestle merged 5 commits intodevelop-patchfrom
fix/7943-lazycollection-regression
Feb 16, 2026
Merged

fix: LazyCollection regression fixes#7952
lukasbestle merged 5 commits intodevelop-patchfrom
fix/7943-lazycollection-regression

Conversation

@lukasbestle
Copy link
Member

@lukasbestle lukasbestle commented Feb 15, 2026

Description

This PR fixes several shortcomings of LazyCollection when in lazy initialization mode. First and foremost the regression in #7943 but also similar issues I found while researching and implementing the fix.

Thanks to @afbora for his great help with debugging.

Changelog

🐛 Bug fixes

  • Using $users->find() with more than one argument or $field->toUsers()/$field->toUser() no longer results in unfiltered collections. $field->toUser() returns wrong user object since 5.3.0 #7943
  • Calling $users->find(false) no longer loads an invalid empty user object.
  • $lazyCollection->prepend() and $users->prepend() ensure the intended element order even if the collection was not initialized before
  • $lazyCollection->empty() and $users->empty() no longer result in populated collections if the original collection was not initialized before

🧹 Housekeeping

  • Add missing code comments on the behavior of $collection->find(false, false, ...$data)

For review team

  • Add changes & docs to release notes draft in Notion

@lukasbestle lukasbestle added this to the 5.3.1 milestone Feb 15, 2026
@lukasbestle lukasbestle self-assigned this Feb 15, 2026
@lukasbestle lukasbestle linked an issue Feb 15, 2026 that may be closed by this pull request
@lukasbestle lukasbestle changed the title docs: Clarify reason for additional false args fix: LazyCollection regression fixes Feb 15, 2026
@lukasbestle lukasbestle merged commit cce56b6 into develop-patch Feb 16, 2026
13 checks passed
@lukasbestle lukasbestle deleted the fix/7943-lazycollection-regression branch February 16, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

$field->toUser() returns wrong user object since 5.3.0

2 participants