diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index d9367db..f122b62 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -8,7 +8,6 @@ namespace Drupal\block; use Drupal\Component\Plugin\PluginBase; -use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** * Defines a base block implementation that most blocks plugins will extend. @@ -19,6 +18,9 @@ */ abstract class BlockBase extends PluginBase implements BlockInterface { + /** + * {@inheritdoc} + */ public function __construct(array $configuration, $plugin_id, array $plugin_definition) { parent::__construct($configuration, $plugin_id, $plugin_definition); diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 9f3a13a..b4caee5 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -201,8 +201,12 @@ public function validate(array $form, array &$form_state) { $form_state['values']['machine_name'] = array_pop($config_id); } $form_state['values']['visibility']['role']['roles'] = array_filter($form_state['values']['visibility']['role']['roles']); - $settings = array(); - $settings['values'] = &$form_state['values']['settings']; + // The Block Entity form puts all block plugin form elements in the + // settings form element, so just pass that to the block for validation. + $settings = array( + 'values' => &$form_state['values']['settings'] + ); + // Call the plugin validate handler. $entity->getPlugin()->validate($form, $settings); } @@ -213,9 +217,12 @@ public function submit(array $form, array &$form_state) { parent::submit($form, $form_state); $entity = $this->getEntity($form_state); + // The Block Entity form puts all block plugin form elements in the + // settings form element, so just pass that to the block for submission. + $settings = array( + 'values' => &$form_state['values']['settings'] + ); // Call the plugin submit handler. - $settings = array(); - $settings['values'] = &$form_state['values']['settings']; $entity->getPlugin()->submit($form, $settings); // Save the settings of the plugin. diff --git a/core/modules/block/lib/Drupal/block/BlockPluginBag.php b/core/modules/block/lib/Drupal/block/BlockPluginBag.php index 73d50c0..9b81441 100644 --- a/core/modules/block/lib/Drupal/block/BlockPluginBag.php +++ b/core/modules/block/lib/Drupal/block/BlockPluginBag.php @@ -31,7 +31,7 @@ class BlockPluginBag extends PluginBag { * The manager to be used for instantiating plugins. * @param array $instance_ids * The ids of the plugin instances with which we are dealing. - * @param Plugin\Core\Entity\Block $entity + * @param \Drupal\block\Plugin\Core\Entity\Block $entity * The Block entity that holds our configuration. */ public function __construct(PluginManagerInterface $manager, array $instance_ids, Block $entity) { @@ -42,7 +42,7 @@ public function __construct(PluginManagerInterface $manager, array $instance_ids } /** - * Overrides \Drupal\Component\Plugin\PluginBag::initializePlugin(). + * {@inheritdoc} */ protected function initializePlugin($instance_id) { if (!$instance_id) { diff --git a/core/modules/block/lib/Drupal/block/BlockStorageController.php b/core/modules/block/lib/Drupal/block/BlockStorageController.php index a59854c..80ce276 100644 --- a/core/modules/block/lib/Drupal/block/BlockStorageController.php +++ b/core/modules/block/lib/Drupal/block/BlockStorageController.php @@ -16,7 +16,7 @@ class BlockStorageController extends ConfigStorageController { /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::load(). + * {@inheritdoc} */ public function load(array $ids = NULL) { $entities = parent::load($ids); @@ -27,7 +27,7 @@ public function load(array $ids = NULL) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::loadByProperties(). + * {@inheritdoc} */ public function loadByProperties(array $values = array()) { $blocks = $this->load(); @@ -40,7 +40,7 @@ public function loadByProperties(array $values = array()) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::preSave(). + * {@inheritdoc} */ protected function preSave(EntityInterface $entity) { parent::preSave($entity); diff --git a/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestBlockInstantiation.php b/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestBlockInstantiation.php index bd67c9b..b3d1bd7 100644 --- a/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestBlockInstantiation.php +++ b/core/modules/block/tests/lib/Drupal/block_test/Plugin/block/block/TestBlockInstantiation.php @@ -23,7 +23,7 @@ class TestBlockInstantiation extends BlockBase { /** - * Overrides \Drupal\block\BlockBase::settings(). + * {@inheritdoc} */ public function settings() { return array( @@ -32,14 +32,14 @@ public function settings() { } /** - * Overrides \Drupal\block\BlockBase::blockAccess(). + * {@inheritdoc} */ public function blockAccess() { return user_access('access content'); } /** - * Overrides \Drupal\block\BlockBase::blockForm(). + * {@inheritdoc} */ public function blockForm($form, &$form_state) { $form['display_message'] = array( @@ -51,14 +51,14 @@ public function blockForm($form, &$form_state) { } /** - * Overrides \Drupal\block\BlockBase::blockSubmit(). + * {@inheritdoc} */ public function blockSubmit($form, &$form_state) { $this->configuration['display_message'] = $form_state['values']['display_message']; } /** - * Implements \Drupal\block\BlockBase::blockBuild(). + * {@inheritdoc} */ protected function blockBuild() { return array(