Select::statesHandler() expects the $select_states variable to be initialized, but that's not guaranteed to be the case. As it turns out, the variable ends up being assigned to the $states variable before being returned anyway. I've fixed the issue by renaming the $select_states variable to $states.
Comments
Comment #2
colanPatch no longer applies. Is this still a problem after upgrading to the latest dev (8.x-1.0-alpha3 with #2873350: Warning: Invalid argument supplied for foreach() in Drupal\conditional_fields\Plugin\conditional_fields\handler\Select->statesHandler)?
Comment #3
colanMarked #2925646: Undefined variable: select_states in Drupal\conditional_fields\Plugin\conditional_fields\handler\Select->statesHandler() and Invalid argument supplied for foreach() in Drupal\conditional_fields\Plugin\conditional_fields\handler\Select->statesHandler() as a duplicate of this issue.
Comment #4
baysaa commentedHere's a reroll against alpha4. I believe patch is still needed to prevent notices.
Comment #5
baysaa commentedComment #6
baysaa commentedI'll reroll against the dev version later.
Comment #7
hawkeye.twolfHere's the re-roll. Note that the previous re-roll missed a crucial change (deletion of the final variable assignment).
Comment #8
brad.bulger commentedCurrent code is still referencing
$select_stateswhen it shouldn't. The patch in 7 assigns to$stateswhich is not returned. It should just use$state. Re-roll attached.Comment #9
dqdThanks for the report and all the efforts/work in here! +1
Is this fix still required and if, it surely needs a re-roll? Thoughts?