-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Clean review_entity_summary when reviews are deleted #1103
Conversation
…ary isn't cleaned properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested yesterday and think this PR isn't complete ....
Can you please test again with ...
- reviews made in backend and frontend
- reviews with ratings (found some strange behavior here)
sorry to come again on this after so long:
Am I missing something? |
I created 3 reviews in Frontend and approved them in Backend. In the database table review_entity_summary columns [reviews_count] and [rating_summary] have changed accordingly. In the Backend I changed the rating and in the table the percentage was recalculated correctly. Then I deleted the reviews one by one and also the changes in the table were correct. After I deleted the last review of the product in the table review_entity_summary there was no record for it, which is correct and the issue I reported initially is solved. Then I created 3 reviews in Backend and I repeated the previous steps, I also didn't find anything wrong, and I didn't find any records in the logs. If there are no objections to the code, my opinion this commit must be merged. |
@fballiano: In table review_entity_summary for a product there are two rows. They differ only in the values on the store_id column, 0 (admin) and 1 (default). Do you know the reason why there is a row for admin? |
no idea 😅 |
Admins what can we do to move this forward? |
Getting some approving Reviews usually helps. |
@addison74 I think you tested the fix, could you "approve" the PR with green button on https://github.com/OpenMage/magento-lts/pull/1103/files (and then select "approve")? Thanks! |
@fballiano - I tested it and I didn't find anything wrong, no errors, Your changes solve that initial issue. Edit - I found the Approve button. Many thanks for pointing me out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array(
Seems good. )
To clean up data: DELETE FROM review_entity_summary WHERE entity_pk_value NOT IN (SELECT entity_pk_value FROM review)
This PR should fix bug #1102
When deleting all reviews of an entity the review_entity_summary isn't cleaned correctly. I tried many different ways to approach the problem but the implemented one seems the easiest and most effective.
Also, the default implementation some of the methods of the Mage_Review modules seem incomplete, they lack the "entity_type" parameters which make the implementations prone to errors when different entities have the same PkValue.