Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mercury_editor
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
mercury_editor
Commits
d8abfb3f
Commit
d8abfb3f
authored
5 months ago
by
Justin Toupin
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3470915
: Not compatible with layout_paragraphs 2.1.0
parent
c794c71a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!63
Fix compatibility with Layout Paragraphs 2.1.x
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mercury_editor.module
+4
-0
4 additions, 0 deletions
mercury_editor.module
src/Controller/InsertComponentController.php
+5
-1
5 additions, 1 deletion
src/Controller/InsertComponentController.php
with
9 additions
and
1 deletion
mercury_editor.module
+
4
−
0
View file @
d8abfb3f
...
...
@@ -198,6 +198,10 @@ function _mercury_editor_replace_ajax_class(&$classes) {
function
_mercury_editor_replace_layout_paragraphs_routes
(
Url
&
$url
)
{
$route_name
=
$url
->
getRouteName
();
$parameters
=
$url
->
getRouteParameters
();
// Compatibility with layout_paragraphs 2.1.x.
if
(
!
empty
(
$parameters
[
'paragraph_type_id'
])
&&
empty
(
$parameters
[
'paragraph_type'
]))
{
$parameters
[
'paragraph_type'
]
=
$parameters
[
'paragraph_type_id'
];
}
$options
=
$url
->
getOptions
();
$route_name
=
str_replace
(
'layout_paragraphs.'
,
'mercury_editor.'
,
$route_name
);
$url
=
Url
::
fromRoute
(
$route_name
,
$parameters
,
$options
);
...
...
This diff is collapsed.
Click to expand it.
src/Controller/InsertComponentController.php
+
5
−
1
View file @
d8abfb3f
...
...
@@ -179,13 +179,17 @@ class InsertComponentController extends ComponentFormController {
*
* Uses mercury editor form class instead of layout paragraphs form class.
*/
public
function
insertForm
(
Request
$request
,
LayoutParagraphsLayout
$layout_paragraphs_layout
,
ParagraphsTypeInterface
$paragraph_type
)
{
public
function
insertForm
(
Request
$request
,
LayoutParagraphsLayout
$layout_paragraphs_layout
,
ParagraphsTypeInterface
|
string
$paragraph_type
)
{
$parent_uuid
=
$request
->
query
->
get
(
'parent_uuid'
);
$region
=
$request
->
query
->
get
(
'region'
);
$sibling_uuid
=
$request
->
query
->
get
(
'sibling_uuid'
);
$placement
=
$request
->
query
->
get
(
'placement'
);
if
(
is_string
(
$paragraph_type
))
{
$paragraph_type
=
$this
->
entityTypeManager
()
->
getStorage
(
'paragraphs_type'
)
->
load
(
$paragraph_type
);
}
$form
=
$this
->
formBuilder
()
->
getForm
(
'\Drupal\mercury_editor\Form\InsertComponentForm'
,
$layout_paragraphs_layout
,
$paragraph_type
,
$parent_uuid
,
$region
,
$sibling_uuid
,
$placement
);
return
$this
->
openForm
(
$form
,
$layout_paragraphs_layout
);
}
...
...
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