Magento2: Error with a nonexistent theme

Created on 23 Sep 2016  路  9Comments  路  Source: magento/magento2

Steps to reproduce

Add theme folder with registration.php.

<?php
/**
 * Copyright 漏 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Magento/Simplicity',
    __DIR__
);

example_1

Fix mistake: 'frontend/Magento/Simplicity'=>'frontend/Vendor/Simplicity',`

example_2

Go to Magento/sample.

Expected result

Something like 404 not found or delete theme if theme folder is not found (and remove from table).

Actual result

Fatal error: Uncaught Error: Call to a member function getId() on null in /vendor\magento\framework\View\Model\Layout\Merge.php:751

example_3

Additional info

| Q | A |
| --- | --- |
| Magento version | 2.1.0 with sample data |
| PHP version | 7 |
| Operating system | Windows 10 x64 |

Frontend Format is not valid Ready for Work bug report non-issue

Most helpful comment

It is critical theme removal leaves system in a state that does not results in exceptions. marking as a bug

All 9 comments

@springimport thank you for your feedback.
Magento does not support Windows. You can fond Magento technology stack requirements here.
Can you confirm that issue is present as well when Linux is used as operating system?

@veloraven Currently no.

I think this error is not related with operating system.

That is an improvement and in backlog already, tiket MAGETWO-46425. At the moment magento can't remove themes from db if it was removed/moved from file system.

I understood, thanks for reply.

It is critical theme removal leaves system in a state that does not results in exceptions. marking as a bug

adding report MAGETWO-46231 to make sure uninstall command removes the theme from DB

Relates to #1596

@springimport, thank you for your report.
This seems to be correct Magento behavior. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this.
Otherwise you may submit Pull Request with the suggested changes.

Hi @magento-engcom-team,

With all due respect, a comment from your colleague @piotrekkaminski (which can be seen above) makes it pretty clear that this is, in fact, a _bug_.
Could you please kindly explain\elaborate, what's changed since then and why? Thanks in advance.

Was this page helpful?
0 / 5 - 0 ratings