Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
layout_builder_browser-3378982
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
layout_builder_browser-3378982
Commits
727a9791
Commit
727a9791
authored
2 years ago
by
Bram Goffings
Committed by
Jimmy Henderickx
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3241658
by aspilicious: Ajax error when no custom blocks types are defined yet
parent
6b079b62
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
layout_builder_browser.info.yml
+1
-0
1 addition, 0 deletions
layout_builder_browser.info.yml
src/Form/BlockForm.php
+7
-2
7 additions, 2 deletions
src/Form/BlockForm.php
with
8 additions
and
2 deletions
layout_builder_browser.info.yml
+
1
−
0
View file @
727a9791
...
...
@@ -3,6 +3,7 @@ core: 8.x
core_version_requirement
:
^8 || ^9
description
:
'
Layout
builder
browser
improvements.'
type
:
module
package
:
'
Layout
Builder'
dependencies
:
-
drupal:layout_builder
configure
:
layout_builder_browser.admin_blocklisting
This diff is collapsed.
Click to expand it.
src/Form/BlockForm.php
+
7
−
2
View file @
727a9791
...
...
@@ -65,12 +65,17 @@ class BlockForm extends EntityForm {
$block_id
=
$browser_block
->
block_id
;
$provider
=
isset
(
$provider_options
[
'Inline blocks'
])
?
'Inline blocks'
:
''
;
if
(
$block_id
)
{
if
(
$block_id
)
{
$provider
=
$block_provider_map
[
$block_id
];
}
if
(
$form_state
->
getValue
(
'provider'
))
{
if
(
$form_state
->
getValue
(
'provider'
))
{
$provider
=
$form_state
->
getValue
(
'provider'
);
}
// When no custom block types are defined the provider is empty, pick the first option as fallback.
if
(
empty
(
$block_provider_map
))
{
reset
(
$block_provider_map
);
$provider
=
key
(
$block_provider_map
);
}
$form
[
'provider'
]
=
[
...
...
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