Skip to content

T15906 onconstruct cached model#16914

Merged
niden merged 4 commits intophalcon:5.0.xfrom
niden-code:T15906-onconstruct-cached-model
Apr 24, 2026
Merged

T15906 onconstruct cached model#16914
niden merged 4 commits intophalcon:5.0.xfrom
niden-code:T15906-onconstruct-cached-model

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented Apr 23, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Fixed Phalcon\Mvc\Model::__unserialize() and Phalcon\Mvc\Model::unserialize() to call onConstruct() after deserialization, so typed properties initialized in onConstruct are correctly set when a model is restored from cache

Fixed Phalcon\Mvc\Model::__unserialize() and Phalcon\Mvc\Model::unserialize() to restore snapshot as the current attributes (instead of null) when a model is deserialized with no pending changes, preventing getChangedFields() from throwing after cache retrieval

@niden niden requested a review from Jeckerson April 23, 2026 23:54
@niden niden self-assigned this Apr 23, 2026
@niden niden added bug A bug report status: medium Medium 5.0 The issues we want to solve in the 5.0 release labels Apr 23, 2026
@niden niden merged commit b208fee into phalcon:5.0.x Apr 24, 2026
61 checks passed
@niden niden deleted the T15906-onconstruct-cached-model branch April 24, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant