Cannot auto refresh "***" as there are unsaved changes after updating to 2.13.4 #7076

Closed
opened 2026-01-22 15:44:09 +01:00 by admin · 4 comments
Owner

Originally created by @SkanderMejdi on GitHub (Nov 24, 2022).

Bug Report

Q A
BC Break no
Version 2.13.4

Summary

Hello,

After updating to 2.13.4, I got an error saying that I cannot auto refresh the entity. Going back to 2.13.3 solved the issue.

Not sure to understand how it is related

Current behavior

  • Use a model factory and create() a proxy
  • Call object() method raises the following error
Cannot auto refresh "***" as there are unsaved changes. Be sure to call ->save() or disable auto refreshing (see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh for details).

Only way to avoid this is to call the method disableAutoRefresh()
Calling save() has no effect

How to reproduce

Create a model factory
call refresh() method

Expected behavior

Create a model factory
call refresh() method
No exception thrown

Thank you ! 🙂

Originally created by @SkanderMejdi on GitHub (Nov 24, 2022). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | no | Version | 2.13.4 #### Summary Hello, After updating to 2.13.4, I got an error saying that I cannot auto refresh the entity. Going back to 2.13.3 solved the issue. Not sure to understand how it is related #### Current behavior - Use a model factory and `create()` a proxy - Call `object()` method raises the following error ``` Cannot auto refresh "***" as there are unsaved changes. Be sure to call ->save() or disable auto refreshing (see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh for details). ``` Only way to avoid this is to call the method `disableAutoRefresh()` Calling `save()` has no effect #### How to reproduce Create a model factory call `refresh()` method #### Expected behavior Create a model factory call `refresh()` method No exception thrown Thank you ! :slightly_smiling_face:
admin added the BugWaiting feedback labels 2026-01-22 15:44:09 +01:00
admin closed this issue 2026-01-22 15:44:09 +01:00
Author
Owner

@derrabus commented on GitHub (Nov 24, 2022):

I'm sorry, but I have no idea what a model factory is. Can you please try to reproduce your issue by using ORM APIs only or report it to where ever this model factory is coming from?

@derrabus commented on GitHub (Nov 24, 2022): I'm sorry, but I have no idea what a model factory is. Can you please try to reproduce your issue by using ORM APIs only or report it to where ever this model factory is coming from?
Author
Owner

@SkanderMejdi commented on GitHub (Nov 25, 2022):

My bad i'm sorry, the error is coming from Zenstruck\Foundry\ModelFactory, I assumed it was coming from doctrine/orm since the error appeared after updating to doctrine 🙏

Thank you and have a good day 🙂

@SkanderMejdi commented on GitHub (Nov 25, 2022): My bad i'm sorry, the error is coming from `Zenstruck\Foundry\ModelFactory`, I assumed it was coming from `doctrine/orm` since the error appeared after updating to doctrine :pray: Thank you and have a good day :slightly_smiling_face:
Author
Owner

@dimabredun commented on GitHub (Jan 18, 2023):

Hi. I'm having the same error with foundry, could you tell me please how did you fix it?

@dimabredun commented on GitHub (Jan 18, 2023): > Hi. I'm having the same error with foundry, could you tell me please how did you fix it?
Author
Owner

@OleksandrConstell commented on GitHub (Feb 23, 2024):

I have the same issue. The issue appeared after I added a new field to the doctrine Entity

#[ORM\Column(type: 'uuid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: UuidV7Generator::class)]
private ?string $uuid = null;
@OleksandrConstell commented on GitHub (Feb 23, 2024): I have the same issue. The issue appeared after I added a new field to the doctrine Entity ``` #[ORM\Column(type: 'uuid', unique: true)] #[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\CustomIdGenerator(class: UuidV7Generator::class)] private ?string $uuid = null; ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7076