You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When validating a doctrine object, the following error is shown;
[TypeError]
Argument 1 passed to Symfony\Component\PropertyInfo\Type::__construct() must be of the type string, null given, called in /Users/victor/Documents/dev/www/sha
res/vendor/symfony/doctrine-bridge/PropertyInfo/DoctrineExtractor.php on line 121
The problem resides due to my indexBy declaration refers to a date column, and there's no support in the DoctrineExtractor class for determining what kind of php-type it refers to.
In vendor/symfony/doctrine-bridge/PropertyInfo/DoctrineExtractor.php:252 ... there's no support for 'date' fields .. eg;
case DBALType::DATE:
return Type::BUILTIN_TYPE_STRING;
And I think it's possibly related to a commit here; b50360f
I started putting together a PR for this but don't understand it well enough to confidently say it won't break something else if it's just declared as a string as above.
My Symfony version is the latest - 5.0.4
The text was updated successfully, but these errors were encountered:
…m and some core types (fancyweb)
This PR was merged into the 3.4 branch.
Discussion
----------
[DoctrineBridge][DoctrineExtractor] Fix indexBy with custom and some core types
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #35542 and #35604
| License | MIT
| Doc PR | -
For #35604:
To guess the collection key type, the `getPhpType()` method is called. But it does not handle most objects and arrays core types. This is why an indexBy datetime does not work.
For #35542:
When the php type cannot be guessed, null is returned. In this case, we cannot pass a valid builtin type to PropertyInfo Type, so we should return null.
Commits
-------
018ec1a [DoctrineBridge][DoctrineExtractor] Fix indexBy with custom and some core types
When validating a doctrine object, the following error is shown;
My field is declared as follows;
The problem resides due to my
indexBy
declaration refers to a date column, and there's no support in the DoctrineExtractor class for determining what kind of php-type it refers to.Something similar is raised here;
#35542
In vendor/symfony/doctrine-bridge/PropertyInfo/DoctrineExtractor.php:252 ... there's no support for 'date' fields .. eg;
And I think it's possibly related to a commit here;
b50360f
I started putting together a PR for this but don't understand it well enough to confidently say it won't break something else if it's just declared as a string as above.
My Symfony version is the latest - 5.0.4
The text was updated successfully, but these errors were encountered: