Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Weird problem


Go to End


5 Posts   2013 Views

Avatar
animasola

Community Member, 121 Posts

21 June 2010 at 6:17pm

I just changed the theme to one which I developed and had these things showing up on the top of the page:

calls without an existing one // to avoid confusion when using the include in different contexts. // Entities without a namespace are deprecated, but widely used. $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '
$MenuTitle.XML
calls without an existing one // to avoid confusion when using the include in different contexts. // Entities without a namespace are deprecated, but widely used. $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '
Copyright © 20010
calls without an existing one // to avoid confusion when using the include in different contexts. // Entities without a namespace are deprecated, but widely used. $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', ' $Page(SidebarImages).Content
$TITLE
$MenuTitle.XML
$MenuTitle.XML
$MenuTitle.XML
CALENDAR
LINKS
$Page(SidebarLinks).Content
calls without an existing one // to avoid confusion when using the include in different contexts. // Entities without a namespace are deprecated, but widely used. $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '
$Breadcrumbs

Here are some visuals to help you picture it out:

View in a browser

Upclose

In the CMS

Hope someone is familiar and can help out. Thanks! :)

Avatar
animasola

Community Member, 121 Posts

22 June 2010 at 4:36pm

any ideas guys? :)

bump!

Avatar
tazzydemon

Community Member, 135 Posts

19 August 2010 at 2:03pm

I too had this when using the Global Theme on SS 2.4 I have also had it on a dev site.

The problem seems to be this code in SSViewer.php

$content = file_get_contents(SSViewer::getTemplateFile($identifier));

// $content = "<!-- getTemplateContent() :: identifier: $identifier -->". $content;
// Adds an i18n namespace to all <% _t(...) %> calls without an existing one
// to avoid confusion when using the include in different contexts.
// Entities without a namespace are deprecated, but widely used.

For some reason when choosing anything other than the default theme in the 2.4 admin the commented code is splatted all over the output. A temporary solution is to remove the commented code entirely.

Julian

Avatar
tazzydemon

Community Member, 135 Posts

19 August 2010 at 2:07pm

I forgot to mention that I also got it over the freshly installed admin until the first refresh - then it went away. Very odd.

I was using apache fcgid at the time and have since changed back to mod_php where the page error occurs

Avatar
Johann

Community Member, 4 Posts

7 September 2010 at 3:36am

Edited: 07/09/2010 4:16am

My proposal for this problem (which also happend on my site running on gomain*go / PHP 5.2.11):

- has nothing to do with different themes,
- in sapphire/core/SSViewer.php you need to change the leading // of the command block starting at line 317 (V2.4.1) into something :

  ...
/* $content = "<!-- getTemplateContent() :: identifier: $identifier -->". $content; 
  * Adds an i18n namespace to all <% _t(...) %> calls without an existing one
  * to avoid confusion when using the include in different contexts.
  * Entities without a namespace are deprecated, but widely used.
  */

  $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '<?= _t(\''. $identifier . '.ss' . '.\\2\\3\'\\4) ?>', $content);
  ...

looks like the <% %> symbols can't be mixed with comment blocks indicated by a leading //!

- I would like to ask silverstripe core developers, to change the code accordingly please.

- in addition, one might like to add the following into mysite/_config.php for a productive site:

  // Director::set_environment_type('live');

  error_reporting(E_ERROR);
  ini_set('display_errors', '0');

Anyone knows, how to configure PHP to prevent this behavior maybe?