getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.57k stars 1.41k forks source link

Virgin site with minor mods no longer loads #476

Closed ghost closed 8 years ago

ghost commented 8 years ago

I installed the Deliver skeleton from scratch installed the admin plugin added admin user logged into admin panel enabled languages en, de, fr tested site loaded correctly with language extensions Wonderful!

I thought admin would have added the languages to the user/config/system.yaml file, but there was no such file, so I added a user/config/system.yaml file and per the docs at http://learn.getgrav.org/content/multi-language added the following to it and nothing more

languages: supported:

I saved the file and now when I load the site I get this error

"Theme 'antimatter' does not exist, unable to display page."

The domains I tried are:

http://domain.com/site http://domain.com/site/en http://domain.com/site/admin

I thought there must be some interference between the yaml files so I deleted the user/config/system.yaml file and the user/config folder to no avail.

I don't know enough yet about Grav to know how to recover the site, so I'll keep the broken version in case anyone needs me to retrieve any info from it and reinstall a new version for myself.

ghost commented 8 years ago

From the log

[2015-11-23 08:41:47] grav.CRITICAL: Call to a member function header() on null - Trace: #0 E:\Web\main\site2\vendor\filp\whoops\src\Whoops\Run.php(357): Whoops\Run->handleError(1, 'Call to a membe...', 'E:\Web\main\sit...', 206) #1 [internal function]: Whoops\Run->handleShutdown() #2 {main} [] []

don't why the e:\web\main\site2 is in there. I had installed the site at that path on a windows box and local server to validate and then zipped the folder and copied it to bluehost linux server where I unzipped it and it appeared to be working fine. I guess I cannot do that?

flaviocopes commented 8 years ago

The user/config/system.yaml file is there even if the admin is not installed. I just tried installing that skeleton, can you re-try the steps from zero and check if at some point that file is deleted or overwritten?

You get that error because the file does not contain the template setting, so it defaults to antimatter but that theme is not installed.

ghost commented 8 years ago

I'm using phpStorm and the mappings weren't all synced so I'm not sure if the file was there before I deleted it. oops. I'll retry and let you know.

I thought I read in the docs that you only need to include items that override the system settings. Is that not correct? Also did you see in the log I posted that my old path was being used somewhere. Does that you mean that you cannot move a site just by copying it?

flaviocopes commented 8 years ago

Ah yes that might be!

If you overwrote the file, the pages.theme setting defaulted to antimatter as set in system/config/system.yaml.

The path in the logs is just a log of the path it finds on the server where it's working. You can move a site just by copying its folder, it's one of the pros of Grav.

ghost commented 8 years ago

I'm doing a reinstall now.

I get that there is not an antimatter theme so it cannot load it, but would it be a good idea to allow the admin panel to still load since it uses its own theme? That's pretty standard and would allow admins to possibly recover their site, if of course the admin panel eventually supported editing the user config params.

I see now that the log was two days old. It was on the windows server at that time, so does not apply to this crash and can be ignored. Sorry about that. There is no log entry from the current crash.

rhukster commented 8 years ago

It really should load fine even if the theme is messed up. However it all really depends on what happened. If you broke something in the configuration, then that really can't be recovered because that is a fundamental thing that even the admin must have to function.

flaviocopes commented 8 years ago

Actually I just tried, removing everything from user/config/system.yaml admin works. But with antimatter installed. But with an unexisting theme name, admin does not work.

ghost commented 8 years ago

As expected when I restored the user/config folder in the existing site, it recovered. When I add the language extension, it also behaved perfectly. I repeated with a virgin install, and it also worked correctly. I think the problem was simply that I trashed the user.config.system file (because I was not synced properly) and since I have no antimatter theme it could not load. And apparently, admin relies on the antimatter theme being present. Thanks for your help guys.

rhukster commented 8 years ago

@flaviocopes is fixing the issue where front-end theme missing stops the admin. That is clearly not intended! :)

flaviocopes commented 8 years ago

Done!