I Just posted a module, https://www.drupal.org/project/ui_patterns_blocks → that includes UI Patterns Settings integration. I'm running into an issue related to #states. Getting the following notice when bringing up a block configuration form that includes UI Patterns form elements:
Notice: Undefined index: #type in Drupal\Core\Form\FormHelper::processStates() (line 208 of core/lib/Drupal/Core/Form/FormHelper.php).
The source is this line in UI Patterns Settings SettingsFormBuilder::buildVariantsForm()
:
$fieldset[$name . '_token']['#states']['invisible'][][$select_selector]['value'] = $variant->getName();
The issue is that $fieldset[$name . '_token']
is not present and so ends up as an array with only the '#states' key, which triggers this core bug:
🐛
Notice: Undefined index: #type in Drupal\Core\Form\FormHelper::processStates()
Needs work
.
What I'm not sure of is: (a) have I done something wrong/unexpected in my integration (i.e. is $fieldset[$name . '_token']
unexpectedly missing), or (b) should the code in SettingsFormBuilder::buildVariantsForm()
be testing for $fieldset[$name . '_token']
before altering it.
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.