Loading src/Form/HomeboxSettingsForm.php +16 −3 Changes for src/Form/HomeboxSettingsForm.php: 16 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\homebox\Form; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Block\BlockManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Theme\ThemeManagerInterface; Loading Loading @@ -208,6 +209,7 @@ class HomeboxSettingsForm extends EntityForm { } foreach ($homebox_blocks as $block) { try { $definition = $this->blockManager->getDefinition($block['id']); $blocks[$block['region']][$block['id']] = [ 'label' => $definition['admin_label'], Loading @@ -216,6 +218,19 @@ class HomeboxSettingsForm extends EntityForm { 'category' => $definition['category'], 'status' => $block['status'], ]; } catch (PluginNotFoundException $e) { $this->logger('homebox')->notice('A block does not exist anymore! Please go to the location of this message and remove it!'); $this->messenger()->addError('There seems to be a broken block! Please remove it or enable the module, which provides this block.'); $blocks[$block['region']][$block['id']] = [ 'label' => $this->t('THIS BLOCK IS BROKEN! PLEASE REMOVE IT!.'), 'entity_id' => $block['id'], 'entity' => NULL, 'category' => $this->t('Broken'), 'status' => $block['status'], ]; } if (isset($block['weight'])) { $blocks[$block['region']][$block['id']]['weight'] = $block['weight']; } Loading Loading @@ -478,8 +493,7 @@ class HomeboxSettingsForm extends EntityForm { ['query' => ['block-enable' => $block_id]] ), ]; } else { } else { $operations['disable'] = [ 'title' => t('Disable'), 'weight' => 40, Loading Loading @@ -543,5 +557,4 @@ class HomeboxSettingsForm extends EntityForm { } return $this->theme; } } Loading
src/Form/HomeboxSettingsForm.php +16 −3 Changes for src/Form/HomeboxSettingsForm.php: 16 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\homebox\Form; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Block\BlockManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Theme\ThemeManagerInterface; Loading Loading @@ -208,6 +209,7 @@ class HomeboxSettingsForm extends EntityForm { } foreach ($homebox_blocks as $block) { try { $definition = $this->blockManager->getDefinition($block['id']); $blocks[$block['region']][$block['id']] = [ 'label' => $definition['admin_label'], Loading @@ -216,6 +218,19 @@ class HomeboxSettingsForm extends EntityForm { 'category' => $definition['category'], 'status' => $block['status'], ]; } catch (PluginNotFoundException $e) { $this->logger('homebox')->notice('A block does not exist anymore! Please go to the location of this message and remove it!'); $this->messenger()->addError('There seems to be a broken block! Please remove it or enable the module, which provides this block.'); $blocks[$block['region']][$block['id']] = [ 'label' => $this->t('THIS BLOCK IS BROKEN! PLEASE REMOVE IT!.'), 'entity_id' => $block['id'], 'entity' => NULL, 'category' => $this->t('Broken'), 'status' => $block['status'], ]; } if (isset($block['weight'])) { $blocks[$block['region']][$block['id']]['weight'] = $block['weight']; } Loading Loading @@ -478,8 +493,7 @@ class HomeboxSettingsForm extends EntityForm { ['query' => ['block-enable' => $block_id]] ), ]; } else { } else { $operations['disable'] = [ 'title' => t('Disable'), 'weight' => 40, Loading Loading @@ -543,5 +557,4 @@ class HomeboxSettingsForm extends EntityForm { } return $this->theme; } }