Jump to:

1382 Posts in 491 Topics by 521 members

Themes

SilverStripe Forums » Themes » Weird problem

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1203 Views
  • animasola
    Avatar
    Community Member
    121 Posts

    Weird problem Link to this post

    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!

  • animasola
    Avatar
    Community Member
    121 Posts

    Re: Weird problem Link to this post

    any ideas guys?

    bump!

  • tazzydemon
    Avatar
    Community Member
    122 Posts

    Re: Weird problem Link to this post

    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

  • tazzydemon
    Avatar
    Community Member
    122 Posts

    Re: Weird problem Link to this post

    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

  • Johann
    Avatar
    Community Member
    4 Posts

    Re: Weird problem Link to this post

    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?

    1203 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.