It causes the following PHP notice:
Notice: Undefined index: items_count in Drupal\Core\Field\WidgetBase::addMoreSubmit() (line 310 of /var/www/html/core/lib/Drupal/Core/Field/WidgetBase.php)
PrivateMessageForm::buildForm constructs the form display of the private message thread to get the members widget from it.
However it uses clone of the formState object, so the WidgetBase::form can't populate the original form state object with the field widget data.
We can pass the original formstate object or try to fill the storage data manually. I don't like any of it
Issue fork private_message-3203419
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
artem_sylchukComment #5
artem_sylchukComment #6
bohartHi @artem_sylchuk,
Something went wrong on this issue.
The commit added this line:
if (empty($storage['field_storage']['#parents']['#fields']['members'])) {
But variable $storage is always empty (as it is never defined).
Should we move `$storage = $form_state_copy->getStorage();` above the if or completely remove those lines?
Thanks!