[SOLVED] Frontend users changesettings template

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
leximus
Forum Members
Forum Members
Posts: 51
Joined: Fri Oct 20, 2006 8:57 pm

[SOLVED] Frontend users changesettings template

Post 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!
Last edited by leximus on Wed Dec 09, 2015 6:50 am, edited 1 time in total.
leximus
Forum Members
Forum Members
Posts: 51
Joined: Fri Oct 20, 2006 8:57 pm

Re: Frontend users changesettings template

Post 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.
Locked

Return to “Modules/Add-Ons”