Field of type entity reference doesn't work with blocks

Created on 8 June 2016, about 8 years ago
Updated 14 January 2024, 8 months ago
  1. Create a field for a content type: Entity reference, Type of item to reference: Block, Limited: 1.
  2. If you test it: the autocomplete field doesn't work in the node edit form. Console: 500 (Internal Server Error)
  3. In the section manage form display, change the widget to select list.
  4. Now go to the final node edit form or click edit on the entity reference field under manage fields.

You get this error:

Drupal\Component\Plugin\Exception\PluginException: The block '' did not specify a plugin. in Drupal\block\BlockPluginCollection->initializePlugin() (line 53 of core/modules/block/src/BlockPluginCollection.php).

Note: a field entity reference with a type of item to reference "View" works correctly.

In earlier versions of the Drupal (8.0.x) this problem did not exist according to my experience.

🐛 Bug report
Status

Closed: works as designed

Version

8.1 ⚰️

Component
Entity reference 

Last updated 15 days ago

No maintainer
Created by

🇨🇭Switzerland handkerchief

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.

  • 🇮🇳India ajmaltash

    You try to remember what block was you were working or removed by other way or imported, then you can use this code
    in any preprocess hook.

    \Drupal::configFactory()->getEditable('block.block.YOURPLUGINBLOCKID')->delete();

Production build 0.71.5 2024