Entity Select issues and PHP warning

Created on 12 December 2022, over 1 year ago
Updated 24 January 2023, over 1 year ago

Problem/Motivation

I am unable to get Entity Select to work.

Steps to reproduce

Create/edit a webform and click to add an "Entity Select" webform element. I get this PHP warning:

Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of /var/www/html/web/core/lib/Drupal/Core/Render/Element/Checkboxes.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'foreach() argum...', '/var/www/html/w...', 113)
#1 /var/www/html/web/core/lib/Drupal/Core/Render/Element/Checkboxes.php(113): _drupal_error_handler(2, 'foreach() argum...', '/var/www/html/w...', 113)
#2 [internal function]: Drupal\Core\Render\Element\Checkboxes::valueCallback(Array, false, Object(Drupal\Core\Form\FormState))
#3 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(1282): call_user_func_array(Array, Array)
#4 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(1000): Drupal\Core\Form\FormBuilder->handleInputElement('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#5 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(1070): Drupal\Core\Form\FormBuilder->doBuildForm('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(574): Drupal\Core\Form\FormBuilder->doBuildForm('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('webform_ui_elem...', Array, Object(Drupal\Core\Form\FormState))
#10 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\webform_ui\Form\WebformUiElementAddForm), Object(Drupal\Core\Form\FormState))

Still, I tried continuing.

  1. Make sure you have an EntityReference view for taxonomy term.
  2. Set a title
  3. Type of item to reference => taxonomy term
  4. Reference Method => Views: filter by an entity reference view
  5. ... (nothing changes, and the "Content Type" checkboxes are still there)
  6. What I expect is a way to select the EntityReference view display I created (there isn't), and for the "Content type" options to be hidden, as they don't make sense in this content. They are required, so I cannot continue or save.

Then, I also noticed an error in the browser console (perhaps when closing the dialog for adding the element):

Uncaught TypeError: Cannot read properties of null (reading 'document')
at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.element.getFrameDocument (ckeditor.js?v=4.18.0:121:144)
at d (ckeditor.js?v=4.18.0:1218:159)
at MutationObserver. (ckeditor.js?v=4.18.0:1217:501)
...

I don't entirely know what needs to happen to fix it or what's wrong. Maybe I'm doing something wrong. But I cannot get Entity Select working or figure out how to use the view I created.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: cannot reproduce

Version

6.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024