Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DataObjectManager : <% sprintf(....) %> displayed on the website

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6
Go to End
Author Topic: 7961 Views
  • JoshuaLewis
    Avatar
    Community Member
    76 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    I thought I would post this here since it's the only thread I've found about <% sprintf(...) %>. Hopefully the info will be helpful to someone that knows more than I do.

    <% sprintf(...) %> has been showing up in my CMS admin since last week when I updated my copy of XAMPP from 1.7.1 to 1.7.3. For me at least the problem seems to be connected with what versions of server software are running since I can install Silverstripe on clean installs of XAMPP 1.7.1 and WAMPServer 2.0i and have everything show up correctly. (XAMPP 1.7.3 runs Apache2.2.14, PHP5.3.1, and mySQL5.1.41 while v1.7.1 and WAMPServer both run slightly older versions of each.)

    WAMPServer is supposed to support easy install of and swapping between different versions of Apache, PHP, MYSQL. I tried to test my theory and replicate the problem by using that feature but for some reason WAMPServer keeps hanging up on something when it restarts after switching to PHP 5.3.1

    Also the sprintf strings show up in installs of different versions of SS but the correct text gets rendered on the pair of remote servers I have ss installed on.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    Thanks.. yeah, it's a weird bug. I think ultimately I may just have to move the translation to the controller and get all that syntax off the template.

  • JoshuaLewis
    Avatar
    Community Member
    76 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    That might need to be done but I should have added earlier that this bug isn't restricted to DOM and is showing up for me in ModelAdmin tabs, Security Group permission tabs, and other places. If this thread hadn't already been here I'd have posted in General Discussion.

    I think that sometime this next week I'll post a bug report but first I want to try and figure out a way of testing and narrowing down what's going on.

  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    Have had the same issue, no real fix for it other than removing the sprintf()...on your local machines. Works fine in most other 'real' linux installations...just not on XAMPP or other windows installations...

    If there is a fix soon...sure would be nice.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    It's really bizarre that this is a server level issue. Does it happen anywhere else in Silverstripe?

  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    I've seen it in ModelAdmin templates as well.

    When you first log into the CMS, the welcome message shows just fine...but if you click on a ModelAdmin then the welcome screen shows it...I'll post a few screenshots.

    the DOM does it on the Button and if no records are there...you'll see in the screenshots.

    here is the thread i started so that i could get the screenshots posted: http://www.silverstripe.org/general-questions/show/280474?showPost=280474

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    Hi,
    I have been trying to track this one down, for me SSViewer seems to support this syntax for the templates:

    <% sprintf(_t('WELCOME1','Welcome to %s. Please choose on one of the entries in the left pane.'),$ApplicationName) %>

    but not this

    <% sprintf(_t('WELCOME1','Welcome to %s. Please choose on one of the entries in the left pane.'),some value) %>

    Some time ago everything in the core templates has been changed into the former syntax. If any of you can understand the following voodoo SSViewer snippet, then it's probably somewhere inside

          // i18n sprintf(_t(...),$argument) with entity only (no dots in namespace), meaning the current template filename will be added as a namespace
          $content = ereg_replace('<' . '% +sprintf\(_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\),\<\?= +([^\?]*) +\?\>) +%' . '>', '<?= sprintf(_t(\''. $path[1] . '.\\2\\3\'\\4),\\6) ?>', $content);
          // i18n sprintf(_t(...),$argument)
          $content = ereg_replace('<' . '% +sprintf\(_t\((\'([^\']*)\'|"([^"]*)")(([^)]|\)[^ ]|\) +[^% ])*)\),\<\?= +([^\?]*) +\?\>) +%' . '>', '<?= sprintf(_t(\'\\2\\3\'\\4),\\6) ?>', $content);

  • timwjohn
    Avatar
    Community Member
    98 Posts

    Re: DataObjectManager : <% sprintf(....) %> displayed on the website Link to this post

    I'm having the same issue in ModelAdmin with DOM, but not anywhere else like some others are. I too am only seeing this issue since upgrading to XAMPP 1.7.3.

    At the moment I'm just gonna remove the sprintf() instances, but am eager to know if anyone gets this sorted. That regular expression mateuzs posted looks painful!

    7961 Views
Page: 1 2 3 4 5 6
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.