18590 Posts in 4875 Topics by 2285 members
General Questions
SilverStripe Forums » General Questions » Empty _config.php file breaks CMS / Website
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 899 Views |
-
Empty _config.php file breaks CMS / Website

23 April 2011 at 11:48pm
I have an empty _config.php file in a widget folder. This seem to break the CMS and front end of the website. If I look at the source of the CMS everything seems fine, but when I look at how the code gets parsed by browers, it seems like it ends the head earlier than it should.
I've included a screenshot wich shows some weird margin bug at the top of the screen and the code as seen by the browser.
-
Re: Empty _config.php file breaks CMS / Website

24 April 2011 at 12:37pm
You should perhaps put at least a <?php line inside that file.
The empty space will likely be occurring since you have white space after a ?> tag. This is why our coding conventions recommend against using ?> tags.
-
Re: Empty _config.php file breaks CMS / Website

24 April 2011 at 1:05pm
Thanks for the reply!
Tha's what I usually do, but then it injects the <?php in the first line of every page.
/admin/EditForm/ gives a JavaScript error when saving a page.
/admin/Editform now starts with:
etc...<?php$('Form_EditForm').getPageFromServer(1);
$('Form_EditForm').loadActionsFromString('<input class=\"action delete\" id=\"Form_EditForm_action_unpublish\"When I look at the source of the cms the doctype line now looks like:
<?php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
It seems to treat the php code as regular text.
When I close the tag again and put <?php ?> in the _config.php file, it doesn't show up in the source, but I get the same error as above because of the whitespace between the tags.
-
Re: Empty _config.php file breaks CMS / Website

18 May 2011 at 9:11am
As a follow up: I ran into the same issue today.
If I put "<?php" into the _config.php file of a module, "<?php" is added at the very start of every page, right before the doctype. As soon as I add a newline to the configuration file, everything works as expected.
Not sure if this is a bug or the punishment for wrong usage, but it's definitely annoying and hard to debug...
-
Re: Empty _config.php file breaks CMS / Website

19 May 2011 at 6:20am
I have the same thing..
I solve it with adding a // on the second line:
<?php
//
| 899 Views | ||
|
Page:
1
|
Go to Top |




