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.

Customising the CMS /

Error Saving Content Tutorial 2 Issue with Date field


Reply


21 Posts   3771 Views

Avatar
bartvanirsel

Community Member, 94 Posts

30 May 2011 at 5:57am

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.

Avatar
bartvanirsel

Community Member, 94 Posts

30 May 2011 at 6:02am

@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;
}

Avatar
Dewey

Community Member, 2 Posts

30 May 2011 at 8:14am

@bartvanirsel

thanks, but that did not work... :(

Avatar
dk

Community Member, 2 Posts

20 June 2011 at 12:46pm

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.

Avatar
Hildarian

Community Member, 6 Posts

29 June 2011 at 5:19pm

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

Avatar
Rod

Community Member, 12 Posts

25 July 2011 at 4:50pm

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

Thanks

Avatar
Hildarian

Community Member, 6 Posts

25 July 2011 at 7:54pm

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

Avatar
Rod

Community Member, 12 Posts

26 July 2011 at 8:32am

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