0

I'm having an issue when applying a custom 'Blank' child theme. I'm running a fresh install of 2.3 on LAMP. I followed the Magento docs with respect to theme.xml and registration.php etc, but after I apply the theme in the admin panel I'm getting this error on the frontend

Exception #0 (InvalidArgumentException): Required parameter 'theme_dir' was not passed

If I try reverting back to the 'blank' theme again in the admin panel, I'm unable to and get this error

Something went wrong while saving this configuration: Required parameter 'theme_dir' was not passed

I'm using a fresh mysql database, so it can't be an old theme in the table issue??

Anyone come across this?

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/webmagento/customtheme',
    __DIR__
);
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Custom Theme</title>
    <parent>Magento/blank</parent>
</theme>
  • you can change value of this design/theme/theme_id in core_config_data table – fmsthird Mar 14 at 17:28
  • Hello @Jusso welcome to the MSE can you please post your code of theme.xml & registration.php file. – ABHISHEK TRIPATHI Mar 15 at 3:55
  • Thank you @ABHISHEKTRIPATHI. – Jusso Mar 15 at 12:59
0

This usually happens when there is a mismatch in themes present in folder structure and themes present in Database "theme" table.

If you are removing theme directly, then follow these steps.

  1. File Operations Delete the content from app/design/frontend/<Vendor>.

Delete all the content of folder var/view_preprocessed & pub/static/frontend.

  1. DB Operations Go to your theme table and delete the entry for your created theme.

Go to your core_config_data table and search for theme and you will get path records like design/theme/theme_id replace your default theme id in it.

  1. Flush cache Flush your cache php bin/magento cache:flush
  • Thank you for your answer. I checked both the theme file structure and database tables and everything matches correctly, but the problem still persists. – Jusso Mar 15 at 14:54
  • can u share screenshot of your theme table? – Sejal Shah Mar 23 at 9:45
0

Okay a rookie error on my behalf! File permissions for <vendor> directory was incorrect. Set to 755 and all good now.

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.