Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lessons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Statistics
lessons
Commits
d9b94048
Commit
d9b94048
authored
Sep 05, 2019
by
ROBERT PATRICK CAREY III
🗿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Exception: in Drupal\book\BookExport->bookExport()
parent
d8cf6bce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
modules/user_preferences/user_preferences.module
modules/user_preferences/user_preferences.module
+4
-3
No files found.
modules/user_preferences/user_preferences.module
View file @
d9b94048
...
@@ -45,6 +45,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
...
@@ -45,6 +45,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
$user
=
\
Drupal
::
currentUser
();
$user
=
\
Drupal
::
currentUser
();
$is_admin
=
in_array
(
'administrator'
,
$user
->
getRoles
());
$is_admin
=
in_array
(
'administrator'
,
$user
->
getRoles
());
$is_front
=
\
Drupal
::
service
(
'path.matcher'
)
->
isFrontPage
();
$is_front
=
\
Drupal
::
service
(
'path.matcher'
)
->
isFrontPage
();
$is_book
=
isset
(
$node
->
book
[
'bid'
]);
if
(
!
$is_admin
){
if
(
!
$is_admin
){
$can_add_child_page
=
in_array
(
'Add content and child pages to books and manage their hierarchies'
,
user_role_permissions
(
$user
->
getRoles
()));
$can_add_child_page
=
in_array
(
'Add content and child pages to books and manage their hierarchies'
,
user_role_permissions
(
$user
->
getRoles
()));
...
@@ -122,7 +123,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
...
@@ -122,7 +123,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
'aria-label'
=>
'Toggle fullscreen'
,
'aria-label'
=>
'Toggle fullscreen'
,
]
]
];
];
if
(
$is_admin
||
$can_add_child_page
){
if
(
(
$is_admin
||
$can_add_child_page
)
&&
$is_book
){
$link
[
'addPage'
]
=
[
$link
[
'addPage'
]
=
[
'title'
=>
t
(
'
'title'
=>
t
(
'
<span class="fa-layers">
<span class="fa-layers">
...
@@ -155,7 +156,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
...
@@ -155,7 +156,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
];
];
*/
*/
}
}
if
(
!
$is_front
){
if
(
!
$is_front
&&
$is_book
){
$link
[
'printerFriendly'
]
=
[
$link
[
'printerFriendly'
]
=
[
'title'
=>
t
(
'<i class="fal fa-print"> </i>'
),
'title'
=>
t
(
'<i class="fal fa-print"> </i>'
),
'url'
=>
Url
::
fromUri
(
'internal:/book/export/html/'
.
$nid
),
'url'
=>
Url
::
fromUri
(
'internal:/book/export/html/'
.
$nid
),
...
@@ -164,7 +165,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
...
@@ -164,7 +165,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
'data-toggle'
=>
'tooltip'
,
'data-toggle'
=>
'tooltip'
,
'data-tippy-content'
=>
t
(
'Printer friendly version'
),
'data-tippy-content'
=>
t
(
'Printer friendly version'
),
'aria-label'
=>
'Printer friendly version'
,
'aria-label'
=>
'Printer friendly version'
,
]
]
];
];
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment