Hello,
I have a very simple registration form. Depending on a select list I have two other fields (one text and one list) that become visible. I get this notice on my pages:
Notice: Undefined offset: 0 in conditional_fields_states_handler_text() (line 1788 of site_name/sites/all/modules/conditional_fields/conditional_fields.module)
In the conditional_fields.module it states
/**
* States handler for text fields.
*/
function conditional_fields_states_handler_text($field, $field_info, $options, &$state) {
// Text fields values are keyed by cardinality, so we have to flatten them.
// TODO: support multiple values.
if ($options['values_set'] == CONDITIONAL_FIELDS_DEPENDENCY_VALUES_WIDGET) {
// Cast as array to handle the exception of autocomplete text fields.
$value = (array) $state[$options['state']][$options['selector']]['value'][0];
$state[$options['state']][$options['selector']]['value'] = array_shift($value);
}
}
Seems the issue is connected with dependent text field. Please advice if there is way to fix it.
I am using the latest dev. Also other similar issues I was able to find:
#1147206: Undefined offset:
#1535332: Undefined offset: 0 in conditional_fields_form_after_build() (line 562 of conditional_fields.module)
Thank you
Comment | File | Size | Author |
---|---|---|---|
#3 | Conditional_Fields-Undefined_index_result_in_eval-2674410-3.patch | 2.86 KB | sandipshirsale |
|
Comments
Comment #1
esmitex CreditAttribution: esmitex commentedI have a similar issue:
Comment #2
sandipshirsale CreditAttribution: sandipshirsale at Clarion Technologies commentedComment #3
sandipshirsale CreditAttribution: sandipshirsale at Clarion Technologies commentedI have created patch, hope it will help you.
Comment #4
g33kg1rl CreditAttribution: g33kg1rl commentedWorked for me. :)