1

I have Magento2 version 2.1.8, when I tried to create new cart price rules after entering all info it doesn't get saved and shows error.

"Something went wrong while saving the rule data. Please review the error log."

Kindly guide me I am beginner in Mangeto.

Thanks

  • You need to first get the error from the /var/log/exception.log file and post it so we can see what is happening. – BAF Dec 12 '17 at 11:01
  • Post your save >> execute() and die before save() – Ronak Chauhan Dec 12 '17 at 11:22
0

A good trick is to search the GitHub repository for Magento 2 for the error strings which will lead you to the classes - this error string appears in two classes. One related to catalog rules and another related to quote - which I would guess would be what we're looking for).

The error is being generated by a catch all Exception block inside this class:

magento2/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php

(or /vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php)

Line ~102 depending on version:

       } catch (\Exception $e) {

            $this->messageManager->addError(

                __('Something went wrong while saving the rule data. Please review the error log.')

            );

I know it's forbidden to play with core, but sometimes these things get a bit annoying - and the update should be temporary only for debugging purposes, unless you need to provide a proper error message to an external system, in which case you'd probably override the method. if you're not on a production server you could try to back up the above file, then add an $e->getMessage() to the error output so you can immediately know why this is failing.

(Since you're a beginner - I would suggest checking the log file and reporting back to us instead of doing this)

} catch (\Exception $e) {

    $this->messageManager->addError(

                __('Something went wrong while saving the rule data. Please review the error log. ERROR: %1', $e->getMessage())

);
  • guys it was permission issue which were causing this error. Thanks for your support – Awais Khan Dec 12 '17 at 12:07

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.