Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
menu_fast_edit
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
menu_fast_edit
Commits
67af32b3
Commit
67af32b3
authored
3 months ago
by
Tor F. Jacobsen
Browse files
Options
Downloads
Patches
Plain Diff
Resolve
#3431948
"D11"
parent
db5c226d
No related branches found
No related tags found
1 merge request
!6
Resolve #3431948 "D11"
Pipeline
#414228
passed
3 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
menu_fast_edit.info.yml
+1
-1
1 addition, 1 deletion
menu_fast_edit.info.yml
src/MenuEditFormAlter.php
+5
-5
5 additions, 5 deletions
src/MenuEditFormAlter.php
with
6 additions
and
6 deletions
menu_fast_edit.info.yml
+
1
−
1
View file @
67af32b3
...
...
@@ -2,6 +2,6 @@ name: Menu Fast Edit
type
:
module
description
:
Enhances the Drupal admin UI to let menu links be added and edited quickly.
package
:
Administration
core_version_requirement
:
^
9
|| ^1
0
core_version_requirement
:
^
10
|| ^1
1
dependencies
:
-
menu_ui
This diff is collapsed.
Click to expand it.
src/MenuEditFormAlter.php
+
5
−
5
View file @
67af32b3
...
...
@@ -131,7 +131,7 @@ class MenuEditFormAlter implements ContainerInjectionInterface {
// Re-order the array to place title and url fields before "operations".
$keys
=
array_keys
(
$element
);
$operations_offset
=
array_search
(
'operations'
,
$keys
);
$operations_offset
=
array_search
(
'operations'
,
$keys
,
TRUE
);
$start
=
array_slice
(
$element
,
0
,
$operations_offset
,
TRUE
);
$end
=
array_slice
(
$element
,
$operations_offset
,
NULL
,
TRUE
);
...
...
@@ -153,10 +153,10 @@ class MenuEditFormAlter implements ContainerInjectionInterface {
// Get the raw uri from the link entity.
// @todo Re-work how to get the raw uri from the link entity.
$parts
=
explode
(
':'
,
$link
->
getPluginId
(),
2
);
if
(
!
empty
(
$parts
[
1
]))
{
if
(
isset
(
$parts
[
1
])
&&
$parts
[
1
]
!==
''
)
{
$uuid
=
$parts
[
1
];
$entity
=
$this
->
entityRepository
->
loadEntityByUuid
(
'menu_link_content'
,
$uuid
);
if
(
!
empty
(
$link
))
{
if
(
isset
(
$link
))
{
/** @var \Drupal\link\Plugin\Field\FieldType\LinkItem $uri_obj */
$uri_obj
=
$entity
->
link
;
$uri_value
=
$uri_obj
->
getEntity
()
->
get
(
'link'
)
->
getValue
();
...
...
@@ -291,7 +291,7 @@ class MenuEditFormAlter implements ContainerInjectionInterface {
// Update the URL, if applicable.
// @todo If "url" is an allowed override in MenuLinkContent, why does it throw an error during "updateDefinition"?
// @todo Update menu link content uri the correct way.
if
(
!
empty
(
$url
)
)
{
if
(
$url
!==
''
)
{
$uri
=
self
::
getUserEnteredStringAsUri
(
$url
);
$menu_link_plugin
=
$this
->
menuLinkManager
->
createInstance
(
$plugin_id
);
/** @var \Drupal\menu_link_content\Entity\MenuLinkContent $entity */
...
...
@@ -398,7 +398,7 @@ class MenuEditFormAlter implements ContainerInjectionInterface {
$uri
=
'route:'
.
$string
;
}
// Detect a schemeless string, map to 'internal:' URI.
elseif
(
!
empty
(
$string
)
&&
parse_url
(
$string
,
PHP_URL_SCHEME
)
===
NULL
)
{
elseif
(
$string
!==
''
&&
parse_url
(
$string
,
PHP_URL_SCHEME
)
===
NULL
)
{
// @todo '<front>' is valid input for BC reasons, may be removed by
// https://www.drupal.org/node/2421941
// - '<front>' -> '/'
...
...
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