Skip to content

fix(Entity): Fix magic setter call for custom strong typed setters - #48008

Merged
provokateurin merged 1 commit into
masterfrom
fix/entity/strict-types
Sep 16, 2024
Merged

fix(Entity): Fix magic setter call for custom strong typed setters#48008
provokateurin merged 1 commit into
masterfrom
fix/entity/strict-types

Conversation

@provokateurin

@provokateurinprovokateurin commented Sep 15, 2024

Copy link
Copy Markdown
Member

For reference: #47984

Summary

When enforcing strict types in Entity.php the fromRow method can fail if the the type to used to store the data in the db is different from the target php type (e.g. bool in sqlite is integer 0/1).
Usually magic methods are used and those don't have strict types, but if you have a custom setter it will trigger an error because the argument type does not match.

Checklist

@provokateurinprovokateurin added 3. to review Waiting for reviews technical debt 🧱 🤔🚀 labels Sep 15, 2024
@provokateurinprovokateurin added this to the Nextcloud 31 milestone Sep 15, 2024
@provokateurin
provokateurin requested review from a team, come-nc, icewind1991, miaulalala and sorbaugh and removed request for a teamSeptember 15, 2024 12:14
Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurinprovokateurin changed the title fix(Entity): Enforce strict types and fix magic settersfix(Entity): Fix magic setter call for custom strong typed settersSep 15, 2024
@provokateurin

Copy link
Copy Markdown
MemberAuthor

Enforcing strict types triggers some Oracle null related problems, so I'm not going to bother with that right now (also makes backporting easier).

@provokateurin

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@provokateurin

Copy link
Copy Markdown
MemberAuthor

/backport to stable29

@provokateurin

Copy link
Copy Markdown
MemberAuthor

/backport to stable28

@provokateurinprovokateurin added bug and removed technical debt 🧱 🤔🚀 labels Sep 15, 2024
@provokateurin
provokateurin merged commit 8a32881 into masterSep 16, 2024
@provokateurin
provokateurin deleted the fix/entity/strict-types branch September 16, 2024 09:08
@skjnldsv

Copy link
Copy Markdown
Member

/backport to stable28

@skjnldsv

Copy link
Copy Markdown
Member

/backport to stable29

@skjnldsv

Copy link
Copy Markdown
Member

/backport to stable30

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@provokateurin@skjnldsv@miaulalala