Page 1 of 1

[SOLVED] Frontend users changesettings template

Posted: Sun Nov 29, 2015 6:15 pm
by leximus
I'm currently updating my production site step by step in order to get it finally ready for CMSMS 2.0. In this process I'm updating frontend users from version 1.22.3, now to 1.25.1
I'm using a costumized changesettings template to call every field manually, which used to work fine under version 1.22.3. After some adaptions, it's working again, but with one exception. The field with the birth date shows up normally, but everytime I'm trying to save the settings, I get an error message, that one required field, in this case the birth date, was empty. Even if the birth date is show correctly.
The code I'm using to call the field:

Code: Select all

{foreach $controls as $key=>$field}
{if isset($field->name)}
{assign var=$field->name value=$field}
{else}
{assign var=$field->propname value=$field}
{/if}
{$gebuertsdatum->prompt} {$gebuertsdatum->marker}:{$gebuertsdatum->control}
All other fields are called in the same way and they work correctly (I've tried to make the birth date not obligatory and removed it and the changesettings template was working fine). So I guess I need to call dates differently?
The site is running with CMS 1.21.1 in production.

Thanks for any suggestions!

Re: Frontend users changesettings template

Posted: Tue Dec 08, 2015 7:20 pm
by leximus
I finally managed to find a solution. In fact it's the use of the ->control tag that caused the problem.
In the new default template, all kind of input fields are not created by using the {$field->control} tag but by using <input type= ...>. So I've changed my fields according to that and replaced $field by the name of the field.
For the birth date this brought me to:
{html_select_date prefix=$gebuertsdatum->input_name start_year='-50' end_year='-14' time=$gebuertsdatum->value}
And now my customized changesettings template is working again. Maybe this could be helpful to someone.