Description
Root cause description
Steps to reproduce
- Add a theme to
app/design/frontend
folder (i.e. clone https://github.com/sivaschenko/magento2-sample-theme toapp/design/frontend/Sivaschenko/default/
) - Login to Admin panel (or just reload the admin panel page)
select * from theme
to ensure theme is added to the database (type
is0
as it is a physical theme)- Remove the theme files/folder
- Reload the admin panel page
select * from theme
(type
for the theme is now changed to1
- virtual theme)- Return the theme files back
- Reload the admin panel page
select * from theme
Actual Result
type
for the theme is still 1
- virtual theme
Expected Result
type
for the theme should be 0
- it's a physical theme
Issue description
Summary (*)
- Install Magento 2.0.4 on WAMP server 3.0 , Windows 10 Pro - 32bit, PHP 5.6.15, MySQL 5.7.9
- Created a child theme themeparent of Magento_blank in app\design\frontend*Vendor1*\themeparent with several layout xml files for extending, along with template .phtml files. Activated from admin. Working Fine.
theme.xml =><parent>Magento/blank</parent>
- Created another child theme themechild of above theme themeparent (which is itself the child of magento blank). This childtheme is created in different vendor folder, i.e. Vendor2
This theme path is app\design\frontend*Vendor2*\themechild . Created layout .xml file inside to extend its parent theme layout. Activated this second level child theme from admin. The .xml files not even processed. Not working.
theme.xml =><parent>Vendor1/themeparent</parent>
3b. Although template .phtml files or .css files existing in childtheme are working fine if corresponding layout containers/blocks called in from the Vendor1\themeparent layout files.
- If for a test, the same child theme childtheme put inside same vendor of its parent i.e. Vendor1 , the theme path becomes app\design\frontend*Vendor1*\themechild and then the same layout .xml files works fine.
Already tried with clearing public/static and var folders. Also, tried after running with cli commands
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento setup:upgrade
But nothing solved it.
Examples (*)
The required theme inheritance is in this way:
Magento_blank => Vendor1_themeparent => Vendor2_childtheme . (note vendor differ)
Layout .xml fail to load in childtheme.
But if for a test, inheritance made this way:
Magento_blank => Vendor1_themeparent => Vendor1_childtheme . (note vendor same)
Layout .xml load properly and work fine in childtheme.
As per Magento 2 guidelines on http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-inherit.html#set-a-parent-theme it is clearly mentioned that "A parent and a child theme can belong to different vendors. For example, your custom theme can inherit from the Magento Blank theme." . So, if I am creating a second level child theme (in vendor 2) from a parent theme (in vendor 1) which is a child of Magento_blank (vendor: Magento), this should ideally work fine. But its not happening. None of the layout .xml files processed to output if they are under different vendors. If I put both themes in same vendor, they are working fine.
Actual result
Extending layout .xml files in the 2nd level child theme in different vendor folder is not working.
Proposed solution
Why Magento 2.0.4 not working properly for 2 level theme inheritance with different vendor names?
This is a serious issue, as if you suppose purchased a paid theme from somewhere (which they have created by inheriting Magento_blank), and now you want to create your child theme of that paid theme but in different vendorname folder (obviously under your companyname), you will not able to do so!
You have only two choices left, either make your child theme inside their vendor name; or edit their theme .xml files to call your child theme template files or .css/.js (if in ur vendorname); the second case will obviously loose updates, weird way and not recommended.
Then what is the solution??
Activity