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

Do not load complete product again from database on pre_update #2781

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from

Conversation

BlackbitDevs
Copy link
Contributor

When a product gets saved, currently during pimcore.dataobject.preUpdate event the whole object gets loaded again from database - only to find out if the published state got changed. This is quite expensive from performance perspective. This PR changes this with a direct SQL query. I am quite sure that you will not accept it because of the SQL inside an event listener but maybe we can find a clean solution...

@dpfaffenbauer
Copy link
Member

@BlackbitDevs the SQL inside the listener is fine, but can you Dependency Inject the SQL Connection and not use \Pimcore\DB ?

@dpfaffenbauer dpfaffenbauer self-requested a review January 16, 2025 07:54
@dpfaffenbauer dpfaffenbauer added this to the 4.1.1 milestone Jan 16, 2025
@dpfaffenbauer
Copy link
Member

ping @BlackbitDevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants