Skip to content
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

[Fix] TagList type error #806

Merged
merged 1 commit into from
Dec 17, 2022
Merged

[Fix] TagList type error #806

merged 1 commit into from
Dec 17, 2022

Conversation

Denoder
Copy link
Contributor

@Denoder Denoder commented Dec 17, 2022

This is causing an error when using relation mode and you have an empty relation and try to save. the method expects an array, but is null so we either put the null value in an array or we can change the type to a nullable type hint. I'm fine with either and will change accordingly.

This is causing an error when using relation mode and you have an empty relation and try to save. the method expects an array, but is null so we either put the null value in an array or we can change the type to a nullable type hint. I'm fine with either and will change accordingly.
@what-the-diff
Copy link

what-the-diff bot commented Dec 17, 2022

  • The method signature of the hydrateRelationSaveValue() was changed from returning an array to a nullable array.
  • This change is made because if $names is empty, it will return an empty value instead of NULL which can cause issues with some database drivers (e.g., SQLite).

@Denoder Denoder changed the title Make into nullable type hint. [Fix] TagList type error Dec 17, 2022
@LukeTowers
Copy link
Member

Thanks @teranode, this had been popping up on a client site from time to time for a while and I hadn't gotten around to diving in to the problem so I appreciate the PR 😄

@LukeTowers LukeTowers added this to the v1.2.2 milestone Dec 17, 2022
@bennothommo bennothommo merged commit fc541b5 into wintercms:develop Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants