Skip to content

Conversation

@nikophil
Copy link
Member

@nikophil nikophil commented Aug 27, 2025

fixes #971

I also enabled the possibility to access objects in data provider even in KernelTestCase, if the factories are not persisting

@nikophil nikophil force-pushed the fix/create-in-data-provider branch from edbfd33 to 975722b Compare August 27, 2025 18:13
@nikophil
Copy link
Member Author

@VincentLanglet I think this fixes your problem, would you mind to test the fix? Since we did not have the same error, I'm not 100% certain it fixes your problem

@nikophil nikophil requested a review from kbond August 27, 2025 18:35
@VincentLanglet
Copy link

@VincentLanglet I think this fixes your problem, would you mind to test the fix? Since we did not have the same error, I'm not 100% certain it fixes your problem

This indeed solve my segmentation fault issue @nikophil.

I had to update my code which was doing $entity1 === $entity2 into $entity1->getId() === $entity2->getId() in order to have a CI green, but I assume it might be a consequences of the change from PersistentObjectFactory to PersistentProxyObjectFactory (?)

@nikophil
Copy link
Member Author

Yes I think so, the proxy mechanism involves some identity problems 🫤

BTW, we're planning to deprecate it, and remove it in Foundry 3

@VincentLanglet
Copy link

BTW, we're planning to deprecate it, and remove it in Foundry 3

Oh, thanks for the news ; I will maybe stick with the PersistentObjectFactory then ^^'

@nikophil nikophil merged commit 67a7731 into zenstruck:2.x Aug 28, 2025
72 checks passed
@nikophil nikophil deleted the fix/create-in-data-provider branch August 28, 2025 05:57
@nikophil
Copy link
Member Author

The fix is released.

I will maybe stick with the PersistentObjectFactory then

yeah that's what I'm already doing 😅

the main feature of those proxies being the "auto-refresh" behavior, we'll replace the whole proxy mechanism by an auto-refresh mechanism relying on PHP 8.4 lazy objects

nikophil added a commit that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation fault in dataprovider with PersistentProxyObjectFactory

2 participants