18

I am facing this error Required parameter 'theme_dir' was not passed when i try to save the product in admin. I checked the theme configuration it was assigned to the stores. Recently i have upgraded from 2.0.7 to 2.1.0.Also i have checked the theme directory registration.php file exists. Anyone came across this issue.

43

This error appears when you remove a template folder, which is still referenced in the database. The simplest way to fix it is, go to the database, and in table 'theme', find the theme name which does not exist in app/design/frontend/package.

DELETE the reference to the missing theme from the table.

| improve this answer | |
  • This should be the accepted answer. – seanbreeden Sep 29 '17 at 15:45
  • PERFECT.. WORKED LIKE A CHARM – Zorox Sep 30 '18 at 7:21
  • This should be the accepted answer. – Daan van den Bergh Oct 25 '18 at 11:09
  • 2 records was extra in my database I deteleted BUt still not working – HaFiz Umer Oct 25 '19 at 6:42
11

I can confirm that the answer by Vu Anh works. Here's an explanation why this happens when products are saved, although the deleted theme is used nowhere:

After saving a product, the image cache is regenerated for all themes. Each theme can have its own image size formats, defined in etc/view.xml and all of these will be generated.

But instead of looking for the configured themes in all stores, Magento goes through all themes in the theme table.

If you did not properly uninstall a theme and just removed the files, the orphaned entry refers to a nonexistent path and the described exception is thrown.

| improve this answer | |
2

I have the same error Required parameter 'theme_dir' was not passed. I work with 2.1.0 from the beginning, not with updating. And I have one custom product attribute "style".

The problem occurs when I try to save the new photo in the material. Without the image, the product saved normally.

Fix with commenting the exception under the file:

vendor/magento/framework/view/design/Fallbck/Rule/Simple.php  

It worked for me. But I think it's a hack.

| improve this answer | |
  • This is definitely a hack. Fix the problem instead of removing the exception. – Daan van den Bergh Oct 25 '18 at 10:50
-4

Finally I fixed it by commenting out the exception under vendor/magento/framework/View/Design/Fallback/Rule/Simple.php.

if (in_array($placeholder, $this->optionalParams)) {
    return [];
} else {
    return [];
    //throw new \InvalidArgumentException("Required parameter '{$placeholder}' was not passed");
}
| improve this answer | |
  • 4
    But this doesn't fix the error, only doesn't show it anymore. (I think Vu Anh's solution is more a fix) – BvdVen Sep 30 '16 at 13:02
  • 3
    This is not the right way of fixing this issue! Check the answer from Vu Anh. – medina Oct 18 '16 at 5:03
  • 2
    This is not a best solution. Please don't do this – Ankit Shah Mar 27 '17 at 4:23

Your Answer

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