Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
homebox
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
homebox
Commits
36cfe009
Commit
36cfe009
authored
3 years ago
by
bonrita
Committed by
Joshua Sedler
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3012844
by bonrita, Grevil: Exception when pre-added view block is deleted
parent
0c0715e9
Branches
Branches containing commit
Tags
2.2.0
Tags containing commit
1 merge request
!5
Issue #3264557: Plan for 2.0.0-alpha1 bugfix release
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Form/HomeboxSettingsForm.php
+24
-11
24 additions, 11 deletions
src/Form/HomeboxSettingsForm.php
with
24 additions
and
11 deletions
src/Form/HomeboxSettingsForm.php
+
24
−
11
View file @
36cfe009
...
...
@@ -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
;
...
...
@@ -208,14 +209,28 @@ class HomeboxSettingsForm extends EntityForm {
}
foreach
(
$homebox_blocks
as
$block
)
{
$definition
=
$this
->
blockManager
->
getDefinition
(
$block
[
'id'
]);
$blocks
[
$block
[
'region'
]][
$block
[
'id'
]]
=
[
'label'
=>
$definition
[
'admin_label'
],
'entity_id'
=>
$block
[
'id'
],
'entity'
=>
NULL
,
'category'
=>
$definition
[
'category'
],
'status'
=>
$block
[
'status'
],
];
try
{
$definition
=
$this
->
blockManager
->
getDefinition
(
$block
[
'id'
]);
$blocks
[
$block
[
'region'
]][
$block
[
'id'
]]
=
[
'label'
=>
$definition
[
'admin_label'
],
'entity_id'
=>
$block
[
'id'
],
'entity'
=>
NULL
,
'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'
];
}
...
...
@@ -478,8 +493,7 @@ class HomeboxSettingsForm extends EntityForm {
[
'query'
=>
[
'block-enable'
=>
$block_id
]]
),
];
}
else
{
}
else
{
$operations
[
'disable'
]
=
[
'title'
=>
t
(
'Disable'
),
'weight'
=>
40
,
...
...
@@ -543,5 +557,4 @@ class HomeboxSettingsForm extends EntityForm {
}
return
$this
->
theme
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment