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

Gedmo Timestampable triggers prePersist events when using findBy #495

Open
Axel29 opened this issue Oct 15, 2024 · 1 comment
Open

Gedmo Timestampable triggers prePersist events when using findBy #495

Axel29 opened this issue Oct 15, 2024 · 1 comment
Labels

Comments

@Axel29
Copy link

Axel29 commented Oct 15, 2024

Describe the bug

Whenever an entity has a Gedmo Timestampable field, if a simple findBy (SELECT) is made on this entity, Gedmo will trigger the prePersist event, even if there's no insert / update made on this entity.

To Reproduce

  1. Create an Entity and add a createdAt + updatedAt field with the associated PHP Attributes for the Gedmo Timestampable
  2. Create an EventListener with the prePersist event listened
  3. Use a simple findBy on the Entity's Repository

Expected behavior

The EventListener is not triggered by the findBy method.

Actual behaivour

The EventListener is triggered by the findBy method.

Additional context

Tested with Symfony 6.4 and PHP 8.3 on the latest version of this bundle + latest version of gedmo.

@Axel29 Axel29 added the Bug label Oct 15, 2024
@stof
Copy link
Owner

stof commented Oct 15, 2024

Please report that to the extensions themselves. This bunde is not the repository where the logic is implemented.

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

2 participants