Problem/Motivation

After enabling the DEV version of this module, the form display page of all content types throw the following error, this did not happen with the beta1 version.

The website encountered an unexpected error. Please try again later.
Error: Class 'Drupal\select2\Plugin\Field\FieldWidget\Select2EntityReferenceWidget' not found in require() (line 23 of modules/contrib/entity_reference_views/src/Plugin/Field/FieldWidget/Select2ViewsWidget.php).
require() (Line: 112)
Symfony\Component\ClassLoader\ApcClassLoader->loadClass('Drupal\entity_reference_views\Plugin\Field\FieldWidget\Select2ViewsWidget')
spl_autoload_call('Drupal\entity_reference_views\Plugin\Field\FieldWidget\Select2ViewsWidget')
class_exists('Drupal\entity_reference_views\Plugin\Field\FieldWidget\Select2ViewsWidget') (Line: 96)
Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('entity_reference_views_select2', Array) (Line: 800)
Drupal\field_ui\Form\EntityDisplayFormBase->getApplicablePluginOptions(Object) (Line: 310)
Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow(Object, Array, Object) (Line: 40)
Drupal\field_ui\Form\EntityFormDisplayEditForm->buildFieldRow(Object, Array, Object) (Line: 218)
Drupal\field_ui\Form\EntityDisplayFormBase->form(Array, Object) (Line: 149)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('entity_form_display_edit_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

- Enable the DEV version of the module.
- Create a content type.
- Browse to the content type's form display page.

CommentFileSizeAuthor
#2 3192105-2.patch586 bytesmohit.bansal623
Command icon 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

seutje created an issue. See original summary.

mohit.bansal623’s picture

Status: Active » Needs review
StatusFileSize
new586 bytes

Please review.

Syntapse’s picture

still an issue today. subscribing for a stable fix on new release

ilciacio’s picture

Applying the patch dose not solve the issue.

Install and enable the https://www.drupal.org/project/select2 module

Add select2 module like dependency in entity_reference_views.info.yml

name: Entity Reference Views
type: module
description: 'Provides functionality to display reference field in a view'
package: Field types
core_version_requirement: ^8.8 || ^9
dependencies:
  - drupal:field
  - drupal:views
  - drupal:select2

  • vijaycs85 committed 2d915d5 on 1.x
    Issue #3192105 by ilciacio, mohit.bansal623, vijaycs85: Class Drupal\...
vijaycs85’s picture

Status: Needs review » Fixed

Thanks for reporting. Since we are adding select2 based field plugins, added the module as a dependecy.

Status: Fixed » Closed (fixed)

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