The log messages translation is using the $element[0] instead $target, and it is causing the error:

"Notice: Undefined offset: 0 in Drupal\field_states_ui\FieldStateManager->apply() (line 213 of modules/contrib/field_states_ui/src/FieldStateManager.php)."

CommentFileSizeAuthor
#4 3089716-4.patch1.93 KBmayurgajar
#3 3089716-3.patch991 bytesseanb
#2 3089716-2.patch566 bytesfelribeiro

Comments

felribeiro created an issue. See original summary.

felribeiro’s picture

StatusFileSize
new566 bytes
seanb’s picture

StatusFileSize
new991 bytes

The patch in #2 seems correct, but I think in some cases it also fails to fetch the proper target. I found an example in a boolean field. There might be more fields that need similar changes.

Patch is attached. Also linking #3145195: #field_parents key not found and #3136297: Get Ajax error when editing paragraph with a field state for $type entity_ref $plugin boolean limit 1 that seem to have similar errors.

mayurgajar’s picture

StatusFileSize
new1.93 KB

Patch for issue occur by custom field Office Hours
https://www.drupal.org/project/office_hours

nickdickinsonwilde’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Needs review » Fixed

Resolved and moved into seperate function so that we don't have 3 virtually identical copies of the logging.
Thanks for the patches and thoughts.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.