1

If I click "Submit Review" button, I am getting error :

"We can't post your review right now."

Have a any idea? Thank you.enter image description here

1

Need more detail regarding this. This message is custom not actual. So for debugging purpose can you write a core file and update original error message here?

  1. vendor/magento/module-review/Controller/Product/Post.php

Line 69: add $e->getMessage() which is original exception. Now should looks like:


} catch (\Exception $e) {
    $this->reviewSession->setFormData($data);
    $this->messageManager->addError(__('We can\'t post your review right now.'.$e->getMessage()));
}
  1. Other case is if form validation is wrong. That means Title, Nickname, and Detail should be required field. So added something error message here to.

$this->reviewSession->setFormData($data);
if (is_array($validate)) {
    foreach ($validate as $errorMessage) {
        $this->messageManager->addError($errorMessage);
    }
} else {
    $this->messageManager->addError(__('We can\'t post your review right now. --- TEST'));
}

Note: After you got an actual exception, then please undo your core change with the original code. Core file modification is not good.

  • Thank you, I added .$e->getMessage())); this code. but still same error. – EK. Feb 17 '19 at 10:54
  • Did you check to validate method? vendor/magento/module-review/Model/Review.php::validate? – Sohel Rana Feb 17 '19 at 11:04
  • Sorry, I tried again. And I add .$e->getMessage())); this code. And I cleaned cache. Now I saw this message. We can't post your review right now.SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s), query was: SELECT rating_option.* FROM rating_option WHERE (rating_option.option_id='38', '34', '45') – EK. Feb 17 '19 at 11:11
  • Admin > Store > Attributes > Rating = If I do quality and value disable, comment system working. What can I do now? thanks. – EK. Feb 17 '19 at 11:44
  • Did you make any customize here? Default with sample data working fine. – Sohel Rana Feb 17 '19 at 11:53
0

Seems this SQL error

Missed data form some REVIEW* tables.

Maybe after cleanup test data :)

Solution - setup fresh & clean Magento 2.

Copy SQL export of data for tables review_status & review_entity,

import to DB of Magento with review bug.

But be carefull with SQL query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.