Incorrect theme identification key
-
15-03-2021 - |
Вопрос
Any time I run bin/magento setup:upgrade
I get Incorrect theme identification key
I understand the source is vendor/magento/framework/View/Design/Theme/FlyweightFactory.php
so I had added echos to try and figure something out
I get
First pass 1, second pass NULL
Now, would be nice to understand where 1 and NULL come from
mysql> select theme_id, theme_path, area from theme;
+----------+-----------------+-----------+
| theme_id | theme_path | area |
+----------+-----------------+-----------+
| 1 | Magento/blank | frontend |
| 2 | Magento/backend | adminhtml |
| 3 | Magento/luma | frontend |
+----------+-----------------+-----------+
mysql> select * from core_config_data where path like '%theme%';
+-----------+----------+----------+-----------------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+----------+----------+-----------------------+-------+
| 34 | stores | 1 | design/theme/theme_id | 3 |
| 58 | websites | 1 | design/theme/theme_id | 3 |
| 82 | default | 0 | design/theme/theme_id | 3 |
+-----------+----------+----------+-----------------------+-------+
Only theme set is 3 (Luma), so I don't get how 1 gets passed. I don't know where the "crontab" area theme is set. Is there anywhere I can set that value so I won't get the error?
Any help is appreciated, happy to provide more info.
Решение
insert into theme VALUES (4, 1, 'Magento/luma', 'Magento Luma Cron', NULL, 0, 'crontab', 0, 'Magento/luma');
This is not recommended but, Try the above it fixed for me.
Другие советы
Although I have no idea what the core issue is (and probably, as stated by @undefinederror, this is just a symptom of a misconfiguration somewhere else, because the crontab
area needing a theme makes little sense to me), I will add that in addition to the new record within the theme
table, I also had to override the DI preferences for Magento\Theme\Model\View\Design
like so:
<type name="Magento\Theme\Model\View\Design">
<arguments>
<argument name="themes" xsi:type="array">
<item name="frontend" xsi:type="string">Magento/luma</item>
<item name="adminhtml" xsi:type="string">Magento/backend</item>
<!-- fix "Incorrect theme identification key" -->
<item name="crontab" xsi:type="string">Magento/luma</item>
</argument>
</arguments>
</type>
I have come across this issue on vanilla Magento 2.3.4-p2 with Smile ElasticSuite. The tldr is here https://github.com/Smile-SA/magento2-module-elasticsuite-cms-search/issues/30#issuecomment-601791232
And the patch/fix is here https://github.com/Smile-SA/magento2-module-elasticsuite-cms-search/commit/cd07d0d1b021dfecb79eff62c210a2b8416e82e8