0

My Magento 2 will not work when I add registration.php to my child theme to register it.

I am creating a child theme for Magento 2. I have pretty much gone through piece by piece and copied from https://github.com/magento/magento2-samples/blob/65832a77b91e592446a49549a75a045b6ff1c673/sample-module-theme/registration.php

as well as gone through the tutorials including http://blog.magestore.com/how-to-create-custom-theme-on-magento-2-part-1/

I have the essential files and I had my /admin crashing when I tried to login.

I went back through and removed all files to a backup folder. I recreated the theme file by file and narrowed it down to the -> "registration.php" file.

Here is mine

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Snowcommerce/lightsnow',
    __DIR__
);  

Here is the sample theme by Magento Core Team

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Magento/sample',
    __DIR__
);

When I go to the admin panel I get this:

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 926404695970

a:4:{i:0;s:139:"File '/Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/app/design/frontend/Snowcommerce/lightsnow/media/preview.jpg' does not exists.";i:1;s:5005:"#0 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Image.php(36): Magento\Framework\Image->open()
#1 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(99): Magento\Framework\Image->__construct(Object(Magento\Framework\Image\Adapter\Gd2), '/Users/camdixon...')
#2 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#3 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#4 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Image/Factory.php(45): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#5 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/View/Design/Theme/Image.php(126): Magento\Framework\Image\Factory->create('/Users/camdixon...')
#6 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/module-theme/Model/Theme/Registration.php(132): Magento\Framework\View\Design\Theme\Image->createPreviewImage('/Users/camdixon...')
#7 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/module-theme/Model/Theme/Registration.php(111): Magento\Theme\Model\Theme\Registration->_savePreviewImage(Object(Magento\Theme\Model\Theme\Data))
#8 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/module-theme/Model/Theme/Registration.php(72): Magento\Theme\Model\Theme\Registration->_registerThemeRecursively(Object(Magento\Theme\Model\Theme\Data))
#9 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/module-theme/Model/Theme/Plugin/Registration.php(56): Magento\Theme\Model\Theme\Registration->register()
#10 [internal function]: Magento\Theme\Model\Theme\Plugin\Registration->beforeDispatch(Object(Magento\Theme\Controller\Adminhtml\System\Design\Theme\Index\Interceptor), Object(Magento\Framework\App\Request\Http))
#11 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Interception/Interceptor.php(121): call_user_func_array(Array, Array)
#12 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/var/generation/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Index/Interceptor.php(40): Magento\Theme\Controller\Adminhtml\System\Design\Theme\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#13 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/App/FrontController.php(55): Magento\Theme\Controller\Adminhtml\System\Design\Theme\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#14 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#15 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#16 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#17 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#18 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#19 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#20 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#21 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#22 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#23 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#24 /Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#25 {main}";s:3:"url";s:108:"/admin/admin/system_design_theme/index/key/3a2b31a8e6cef34dc0aa00bc0e674a1f9b40d112e1d8fbf5435ac2e66c67f9de/";s:11:"script_name";s:10:"/index.php";}
1

for some reason, an exception is raised when you activate your theme.

To see the actual error Message, have a look at the File {magento_root}/var/report/926404695970

It's also a good idea to enable developer mode, which should then display the error message in your Browser instead of writing it to the report file.

The different Magento2 Modes are described here: http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html

To change the Magento Mode, have a look at this: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html

basically you have to execute bin/magento deploy:mode:set developer from your magento root dir

  • I added the log, but not sure what everything means. – camdixon May 17 '16 at 20:13
  • just have a look at the first line: File '/Users/camdixon/Sites/snowcommerce/deckthehome/dth.dev/app/design/frontend/Snowcommerce/lightsnow/media/preview.jpg' does not exists." Seems like you defined a preview file in your theme configuration that does not exist in your theme – David Verholen May 17 '16 at 20:19
  • Yep, that did it! – camdixon May 17 '16 at 20:24

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.