edit_join_field issue

vnevermore

Member
Hello, community,

I'm working again on the files on a new project and on the very first edit I've noticed an issue on the edit_join_field.php file.
Checking the code there's an initialization of the $TMPL['error_field_choice_value_0'] var at ''; (null)

However on the "first use" of the var inside the loop,
there's .= operator on a var that does not exist actually

Code:
    $TMPL['error_field_choice_value_0'] = '';
    $TMPL['error_style_field_choice_value_0'] = '';
Code:
    for ($i = 1; $i < $TMPL['count']; $i++) {
        $TMPL['error_field_choice_value_'.$i] .= '';
        $TMPL['error_style_field_choice_value_'.$i] .= '';

        $extra_choices .= '<p class="'.$TMPL['error_style_field_choice_value_'.$i].'">
                             <input type="text" size="50" name="field_choice_value[]" value="'.$choice_value_array[$i].'" placeholder="'.$LNG['a_man_jf_value'].'" />
                             <input type="text" size="50" name="field_choice_text[]" value="'.$choice_text_array[$i].'" placeholder="'.$LNG['a_man_jf_displaytext'].'" />
                             <a href="#" class="remove_input">'.$LNG['a_man_jf_remove'].'</a>
                             '.$TMPL['error_field_choice_value_'.$i].'
                          </p>';
    }
 

Mark

Administrator
Staff member
Basti is not around these days but I'm assuming
PHP:
        $TMPL['error_field_choice_value_'.$i] .= '';
        $TMPL['error_style_field_choice_value_'.$i] .= '';
should have been:
PHP:
        $TMPL['error_field_choice_value_'.$i] = '';
        $TMPL['error_style_field_choice_value_'.$i] = '';
I will make a note of it and get it fixed for next release, but it should only cause an undefined index notice in cases where there is more than 1, nothing catastrophic but a good catch.
 

vnevermore

Member
Yes exactly, indeed will not affect the performance or the usage somehow however, it needs to get fixed. I fixed it on my own sources.
Thanks for your attention, I am coming back with another report
 

Basti

Administrator
Staff member
Thats actually fixed already in the backend for next release, good find anyway :)
 
Top