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.

Comments

handkerchief created an issue. See original summary.

asghar’s picture

Hi
I have tested on 8.1.2 and could not able to produce the issue. If you face the same issue in the current version then please write the producing steps. Thanks

handkerchief’s picture

hi asghar
thanks for your response. Hm you're right, i testet it on https://simplytest.me (8.1.2) and it works well. But my project where the error occurs has also the version 8.1.2. Maybe other modules or configurations are the reason. I will make some other tests, debugging my project and try to find the wrongdoer. I'll be back with more information.

handkerchief’s picture

i can't believe it. Hours of searching and debbuging...

And the simple solution: save again the block admin page (admin/structure/block) and the error is gone.

In past, i had some similar issues in Drupal 8. For example with translation errors. Go to content translation admin page (admin/config/regional/content-language) and make a resave: the errors were gone. It's magic, and frustrating.

handkerchief’s picture

Status: Active » Closed (works as designed)
adubovskoy’s picture

The same error. Features settings page won't work. Drush features-status the same.


mylvwddv@s6 features]$ drush features-status
Drupal\Component\Plugin\Exception\PluginException: The block '' did not specify a plugin. in [error]
/home/mylvwddv/public_html/core/modules/block/src/BlockPluginCollection.php:53
Stack trace:
#0 /home/mylvwddv/public_html/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80):
Drupal\block\BlockPluginCollection->initializePlugin(NULL)
#1 /home/mylvwddv/public_html/core/modules/block/src/BlockPluginCollection.php(45): Drupal\Component\Plugin\LazyPluginCollection->get(NULL)
#2 /home/mylvwddv/public_html/core/modules/block/src/Entity/Block.php(138): Drupal\block\BlockPluginCollection->get(NULL)
#3 /home/mylvwddv/public_html/core/modules/block/src/Entity/Block.php(201): Drupal\block\Entity\Block->getPlugin()
#4 /home/mylvwddv/public_html/modules/contrib/features/src/FeaturesManager.php(1069): Drupal\block\Entity\Block->label()
#5 /home/mylvwddv/public_html/modules/contrib/features/src/FeaturesManager.php(1138): Drupal\features\FeaturesManager->listConfigByType('block')
#6 /home/mylvwddv/public_html/modules/contrib/features/src/FeaturesManager.php(238):
Drupal\features\FeaturesManager->initConfigCollection(false)
#7 /home/mylvwddv/public_html/modules/contrib/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php(30):
Drupal\features\FeaturesManager->getConfigCollection()
#8 /home/mylvwddv/public_html/modules/contrib/features/src/FeaturesAssigner.php(163):
Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentPackages->assignPackages(false)
#9 /home/mylvwddv/public_html/modules/contrib/features/src/FeaturesAssigner.php(154):
Drupal\features\FeaturesAssigner->applyAssignmentMethod('packages', false)
#10 /home/mylvwddv/public_html/modules/contrib/features/drush/features.drush.inc(152): Drupal\features\FeaturesAssigner->assignConfigPackages()
#11 /home/mylvwddv/public_html/modules/contrib/features/drush/features.drush.inc(162): _drush_features_options()
#12 /opt/drush/drush-8.x/includes/command.inc(422): drush_features_status()
#13 /opt/drush/drush-8.x/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#14 /opt/drush/drush-8.x/includes/command.inc(199): drush_command()
#15 /opt/drush/drush-8.x/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#16 /opt/drush/drush-8.x/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#17 /opt/drush/drush-8.x/drush.php(12): drush_main()
#18 {main}

ajmaltash’s picture

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();

this code will remove broken block and then remove this code. Refresh cache.