Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Error Saving Content Tutorial 2 Issue with Date field

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

Page: 1 2 3
Go to End
Author Topic: 3694 Views
  • bartvanirsel
    Avatar
    Community Member
    94 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    Might have something to do with setting the locales in your site in _config.php:

    // Set the site locale (this one is in dutch)
    i18n::set_locale('nl_NL');
    i18n::set_default_locale('nl_NL');

    setlocale(LC_TIME, i18n::get_locale() . '.utf8');

    I use this and it works in the CMS fields and it works:

    $df->setConfig('dateformat', 'dd-MM-YYYY');

    hope this helps a bit.

  • bartvanirsel
    Avatar
    Community Member
    94 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    @Noel

    Maybe something like this in your template:

    <% control FewChildren(3) %>
    <% end_control %>

    and something like this in you controller:

    function FewChildren($limit) {
    $littlechildren = DataObject::get("SiteTree", "ParentID = $this->ID", "", null, $limit);
    return $littlechildren;
    }

  • Dewey
    Avatar
    Community Member
    2 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    @bartvanirsel

    thanks, but that did not work...

  • dk
    Avatar
    Community Member
    2 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    I have exactly this problem, out of the box using the tutorial code.

    Tutorial works fine if I omit the date when saving a new article, but as soon as I enter text in for the date field in the articlepage, I get error saving content message.

    PHP log shows this: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/www/sapphire/thirdparty/Zend/Locale/Format.php on line 665

    This line of code is: $day = iconv_strpos($format, 'd');

    I have inconv installed in my php.ini - any ideas?

    Anything to do with me setting up DB as unicode? vs. my php.ini iconv saying:

    iconv

    iconv support   enabled
    iconv implementation   libiconv
    iconv library version   1.13

    Directive   Local Value   Master Value
    iconv.input_encoding   ISO-8859-1   ISO-8859-1
    iconv.internal_encoding   ISO-8859-1   ISO-8859-1
    iconv.output_encoding   ISO-8859-1   ISO-8859-1

    Very frustrating that out of the box the simple tutorial doesn't work with not much guidance on dependencies if this is the problem.

    Thanks for any help.

  • Hildarian
    Avatar
    Community Member
    6 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    Hi dk! Did you get this to work in the end because I am stuck on the same problem... Hilda

  • Rod
    Avatar
    Community Member
    12 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    I have the same problem as dk and others. It's driving me nuts! Has anyone solved this?

    Thanks

  • Hildarian
    Avatar
    Community Member
    6 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    Hi Rod, I got this answer from Will.... Have made the change but have not had a chance to test it yet. Hope it works!

    >>>
    Hi Hilda,

    As the error message states in that "Fatal error</b>: Maximum execution time of 30 seconds exceeded".. You will need to up the execution time for your server.

    This is a general PHP level configuration rather than SilverStripe specific so you can find more documentation on how to do this online eg http://forum.mamboserver.com/showthread.php?t=26407

    Cheers
    --
    Will Rossiter | Developer
    SilverStripe
    http://www.silverstripe.com

  • Rod
    Avatar
    Community Member
    12 Posts

    Re: Error Saving Content Tutorial 2 Issue with Date field Link to this post

    Hi Will,

    It's the fact that it's timing out that's the issue though. If I omit the date in the date field, the page saves instantly. As soon as I try saving with a date entered it times out. Can you think of anything else that could be causing this? I have the exact symptoms mentioned by dk.

    Liam

    3694 Views
Page: 1 2 3
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.