Juergen Mainka
May 26, 2013, 01:39 AM
Hi Flynaxers,
I'd found a fatal bug in the templates of the Escort-Version (4.1):
I you create a Yes/No-Field than it won't be stored in the database!!!!
Class rlFields.class.php (subdir admin) around line 245:
$alter = "ALTER TABLE `" . RL_DBPREFIX . "{$this -> source_table}` ADD `{$key}` ENUM( '0', '1' ) DEFAULT '{$info['Default']}' NOT NULL";
You define here the database field as an ENUM. How ever that's o.k.
In the templates (for example the reg_account.tpl around line 222) this code:
{elseif $field.Type == 'bool'}
<label><input type="radio" value="on" name="account[{$field.Key}]" {if $fVal.$fKey == 'on'}checked="checked"{elseif $field.Default}checked="checked"{/if} /> {$lang.yes}</label>
<label><input type="radio" value="off" name="account[{$field.Key}]" {if $fVal.$fKey == 'off'}checked="checked"{elseif !$field.Default}checked="checked"{/if} /> {$lang.no}</label>
You can see that in the template-code are the words "on" and "off" defined.
Replace "on" ==> "1" and "off" ==> "0"
It should be looks like:
{elseif $field.Type == 'bool'}
<label><input type="radio" value="1" name="account[{$field.Key}]" {if $fVal.$fKey == '1'}checked="checked"{elseif $field.Default}checked="checked"{/if} /> {$lang.yes}</label>
<label><input type="radio" value="0" name="account[{$field.Key}]" {if $fVal.$fKey == '0'}checked="checked"{elseif !$field.Default}checked="checked"{/if} /> {$lang.no}</label>
This must be changed in ALL template files related with bool fields.
The same bug is also in the new "Escort Sun Cocktail"-templates!!
Please update the templates ASAP. Changing the core-code (classes etc.) will end in more work like database update etc.
Regards
J. Mainka
I'd found a fatal bug in the templates of the Escort-Version (4.1):
I you create a Yes/No-Field than it won't be stored in the database!!!!
Class rlFields.class.php (subdir admin) around line 245:
$alter = "ALTER TABLE `" . RL_DBPREFIX . "{$this -> source_table}` ADD `{$key}` ENUM( '0', '1' ) DEFAULT '{$info['Default']}' NOT NULL";
You define here the database field as an ENUM. How ever that's o.k.
In the templates (for example the reg_account.tpl around line 222) this code:
{elseif $field.Type == 'bool'}
<label><input type="radio" value="on" name="account[{$field.Key}]" {if $fVal.$fKey == 'on'}checked="checked"{elseif $field.Default}checked="checked"{/if} /> {$lang.yes}</label>
<label><input type="radio" value="off" name="account[{$field.Key}]" {if $fVal.$fKey == 'off'}checked="checked"{elseif !$field.Default}checked="checked"{/if} /> {$lang.no}</label>
You can see that in the template-code are the words "on" and "off" defined.
Replace "on" ==> "1" and "off" ==> "0"
It should be looks like:
{elseif $field.Type == 'bool'}
<label><input type="radio" value="1" name="account[{$field.Key}]" {if $fVal.$fKey == '1'}checked="checked"{elseif $field.Default}checked="checked"{/if} /> {$lang.yes}</label>
<label><input type="radio" value="0" name="account[{$field.Key}]" {if $fVal.$fKey == '0'}checked="checked"{elseif !$field.Default}checked="checked"{/if} /> {$lang.no}</label>
This must be changed in ALL template files related with bool fields.
The same bug is also in the new "Escort Sun Cocktail"-templates!!
Please update the templates ASAP. Changing the core-code (classes etc.) will end in more work like database update etc.
Regards
J. Mainka