You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BOCategory: Back OfficeBugType: BugdevelopBranchMinorSeverity: minor bug > https://build.prestashop.com/news/severity-classificationModuleModuleProductcommentsModule: productcommentsVerifiedThe issue has been reproduced
When user admin, on the productcomments module backoffice page, use the "Delete" button to delete a comment that has been reported as abusive, then after the page is refreshed a fatal error is thrown
PrestaShop\Module\ProductComment\Repository\ProductCommentRepository::delete(): Argument #1 ($entity) must be of type PrestaShop\Module\ProductComment\Entity\ProductComment, null given, called in /Users/AAA/www/prestashop/PrestaShop/modules/productcomments/productcomments.php on line 210
Expected behavior
The "delete" button should successfully delete the comment and not display an error page
Steps to reproduce
Install PrestaShop develop branch
Open a first tab, go to front-office, create a customer account. Then open a product Front-office page and review the product: you need to submit a comment about the product. The comment is submitted but must be approved by a shop admin.
Open a 2nd tab, you login on backoffice, go to module manager Backoffice page, then "configure" module "Product Comments"
On 2nd tab, approve the comment.
On 1st tab refresh the product page: now the comment can be seen.
On the 1st tab, use the "report abusive comment" flag icon to report the comment
Back on 2nd tab, on the productcomments module backoffice page you should see the reported comment
Click on "Delete" button next to reported comment
Refresh the page, see the fatal error
PrestaShop version(s) where the bug happened
9.0.0
PHP version(s) where the bug happened
8.2
If your bug is related to a module, specify its name and its version
productcomments 6.0.2
Your company or customer's name goes here (if applicable).
No response
The text was updated successfully, but these errors were encountered:
Mmmm looks like the root cause is that I refresh at step 9
As the URL contains the parameter for the action, the module attempts to delete the comment again, and it fails because the comment was successfully deleted at step 8.
I reproduce the issue with PrestaShop version develop, I'll add this to the backlog so it can be fixed.
Screen.Recording.2023-11-13.at.10.59.43.mov
When I refresh my page, I have the following exception :
Please be aware that some issues might take a very long time to be resolved. If this one is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider contacting a professional to help you.
If you fix the issue on your end, please contribute it back to the project. Remember that the more people contribute, the better PrestaShop becomes for everyone.
BOCategory: Back OfficeBugType: BugdevelopBranchMinorSeverity: minor bug > https://build.prestashop.com/news/severity-classificationModuleModuleProductcommentsModule: productcommentsVerifiedThe issue has been reproduced
Prerequisites
Describe the bug and add attachments
When user admin, on the productcomments module backoffice page, use the "Delete" button to delete a comment that has been reported as abusive, then after the page is refreshed a fatal error is thrown
Expected behavior
The "delete" button should successfully delete the comment and not display an error page
Steps to reproduce
develop
branchPrestaShop version(s) where the bug happened
9.0.0
PHP version(s) where the bug happened
8.2
If your bug is related to a module, specify its name and its version
productcomments 6.0.2
Your company or customer's name goes here (if applicable).
No response
The text was updated successfully, but these errors were encountered: