the $element array comes in differently to the field_states_ui_field_widget_alter function in core 8.6 than it did in 8.5 causing a wsod with "Recoverable fatal error: Argument 6 passed to field_states_ui_get_states() must be of the type array, null given, called in ...field_states_ui/field_states_ui.form.inc"

The attached patch should cover all entity reference cases (or at least the ones I've found). Patch attached.

Comments

el1_1el created an issue. See original summary.

el1_1el’s picture

StatusFileSize
new2.07 KB

I needed to move

+  if (isset($element[0])) {
+    $element = $element[0];
+  }

for ALL elements. I believe this is an incompatibility when using field_states_ui with paragraphs, but dont have time for a proper debug. This part of the patch may need to be a separate issue, so hopefully others have suggestions as well.

el1_1el’s picture

Title: entity reference errors in core 8.6 » entity reference and paragraph errors in core 8.6
el1_1el’s picture

Title: entity reference and paragraph errors in core 8.6 » entity reference, paragraph, link errors in core 8.6
StatusFileSize
new3.3 KB

And now an error with link fields also

el1_1el’s picture

Status: Active » Needs work

I elected to restructure my data model after getting a variety of odd errors.

nickdickinsonwilde’s picture

Status: Needs work » Closed (outdated)

$element/$element[0] are I believe resolved in 8.x-2.x.
Can't replicate link error, added paragraph to supported fields.