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.
4 Answers
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.
-
-
-
-
2 records was extra in my database I deteleted BUt still not working Oct 25, 2019 at 6:42
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.
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.
-
This is definitely a hack. Fix the problem instead of removing the exception. Oct 25, 2018 at 10:50
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");
}
-
4But this doesn't fix the error, only doesn't show it anymore. (I think Vu Anh's solution is more a fix)– BvdVenSep 30, 2016 at 13:02
-
3This is not the right way of fixing this issue! Check the answer from Vu Anh.– medinaOct 18, 2016 at 5:03
-
2
-
This doesn't fix the issue, it's just hiding the error. Need to know the root cause of the issue. Sep 27, 2020 at 6:46
-
i feel like you are trying to make fun of error. Ok. HAHAHA there you go.– Ali RazaOct 15, 2021 at 7:15