AliceDataFixtures: ObjectManagerPersister bad arguments
Hello
Following this issue : https://github.com/theofidry/AliceBundle/issues/6
I just updated theofidry/alice-data-fixtures to 1.5.1 and got this error by launching fixtures :
Fidry\AliceDataFixtures\Bridge\Doctrine\Persister\ObjectManagerPersister::g
etMetadata(): Argument #2 ($object) must be of type object, array given, ca
lled in /app/vendor/theofidry/alice-data-fixtures/src/Bridge/Doctrine/Persi
ster/ObjectManagerPersister.php on line 158
I updated hautelook/alice-bundle to 2.10 as well.
Thanks you
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Downgrade theofidry/alice-data-fixtures. See theofidry/AliceDataFixtures#202. — committed to coopcycle/coopcycle-web by alexsegura 2 years ago
- fix(persister): added condition to check if entity values are array, fixes https://github.com/theofidry/AliceDataFixtures/issues/202 — committed to santoslluis/AliceDataFixtures by santoslluis 2 years ago
Hello
I’ve the same issue since i’ve updated
theofidry/alice-data-fixturesto 1.5.1.I my case, it’s appear because into my fixtures i’m using array:
To testing and try to understand where is the problem, i’ve added this condition into the ObjectManagerPersister before the testing line with null, and all is fine now (i known it’s a bad idea to do this) :
There is another possibility to replace an array by a collection into fixtures (because collection is managed)? Or it’s necessary to update the library?
Thanks for your help.
Hi @theofidry,
I have tested and I can confirm #207 is solving the issue for me.
Thx @titiyoyo
I have the same issue. It worked just fine before this update.
Please consider reverting the change as I think this is a breaking change. Even if this was not intended to work with array instead of Collection, it did, and it was not clear that it should not work.
The only comment i’ve with your remarks, that’s before your last update of the library all is fine with this syntax, i think because we have now a strict types component enabled by default.
Thanks for your time.
I think it’s the exact same error: a collection (for relationships) in Doctrine must be Collection instances AFAIK so having an array/iterable there is wrong in that regard
On Mon 17 Jan 2022 at 15:49, Helo @.***> wrote: