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

[Bug]: setMaxItems expects int, but includes a integerCast function #16051

Closed
valentin- opened this issue Oct 4, 2023 · 1 comment
Closed
Labels

Comments

@valentin-
Copy link
Contributor

valentin- commented Oct 4, 2023

Pimcore version

11.0.11

Steps to reproduce

Im currently performing an update from Pimcore 10 to 11.

I get following error in the backend:

Message: Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation::setMaxItems(): Argument #1 ($maxItems) must be of type ?int, string given, called in /app/vendor/pimcore/pimcore/models/DataObject/ClassDefinition/Data.php on line 226

Probably there are some values stored wrongly in the database (as string), as the classes were created with Pimcore 10. I'm confused as setMaxItems expects an int value, but getAsIntegerCast allows mixed with a further check.

public function setMaxItems(?int $maxItems): static
(other locations also)

Is it intended to be ?int or should it also be mixed?

This also affects setMaxTabs

@valentin- valentin- added the Bug label Oct 4, 2023
@blankse
Copy link
Contributor

blankse commented Oct 8, 2023

There are migrations in 10.x to migrate the empty string values to null. See #15890 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants