Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
0b4c3b64
Commit
0b4c3b64
authored
4 years ago
by
Eric Bremner
Committed by
Kevin Paxman
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4653: fixing getting the menu when using subfoldered Drupal sites
parent
e2cf1456
No related branches found
No related tags found
1 merge request
!61
ISTWCMS-4653: checking for unpublished nodes when getting the menu
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UWService.php
+10
-1
10 additions, 1 deletion
src/Service/UWService.php
with
10 additions
and
1 deletion
src/Service/UWService.php
+
10
−
1
View file @
0b4c3b64
...
...
@@ -293,6 +293,11 @@ class UWService implements UWServiceInterface {
*/
public
function
uwGetMenu
(
string
$menu_name
=
'main'
,
bool
$count_menu_items
=
FALSE
,
bool
$include_parent_in_count
=
FALSE
):
array
{
// The base path, need this for removing when on subfoldered sites,
// for example d8/fdsu5/, we need to remove the fdsu5 from the path
// alias.
global
$base_path
;
// Get the main menu from the simplify menu module.
$menu
=
$this
->
simplifyMenu
->
getMenuTree
(
$menu_name
);
...
...
@@ -302,8 +307,12 @@ class UWService implements UWServiceInterface {
// Step through each menu and ensure that it is published.
foreach
(
$menu
as
$key
=>
$m
)
{
// Remove the base path from the url so that we can get
// the actual content from the path alias.
$alias
=
str_replace
(
$base_path
,
''
,
$m
[
'url'
]);
// Get the path from the URL of the menu link.
$path
=
$this
->
pathAliasManager
->
getPathByAlias
(
$m
[
'url'
]
);
$path
=
$this
->
pathAliasManager
->
getPathByAlias
(
'/'
.
$alias
);
// Check if it is a node path and if so check if published.
if
(
preg_match
(
'/node\/(\d+)/'
,
$path
,
$matches
))
{
...
...
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