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
1f9920ce
Commit
1f9920ce
authored
2 years ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-5709: fixing undefined value error
parent
b819bab2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!264
ISTWCMS-5709: removing the author from the teaser for news and blog
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UwNodeFieldValue.php
+3
-6
3 additions, 6 deletions
src/Service/UwNodeFieldValue.php
with
3 additions
and
6 deletions
src/Service/UwNodeFieldValue.php
+
3
−
6
View file @
1f9920ce
...
@@ -650,13 +650,9 @@ class UwNodeFieldValue {
...
@@ -650,13 +650,9 @@ class UwNodeFieldValue {
*/
*/
public
function
getAuthor
(
Node
$node
):
array
{
public
function
getAuthor
(
Node
$node
):
array
{
// Get the author field from the node, if there is
// no author specified the value will be NULL.
$author_name
=
$node
->
field_author
->
value
;
// If there is no author in the field, get the owner
// If there is no author in the field, get the owner
// of the blog post.
// of the blog post.
if
(
!
$author
_name
)
{
if
(
!
$
node
->
field_
author
)
{
// Set the author to the person who made blog.
// Set the author to the person who made blog.
$author
=
[
$author
=
[
...
@@ -670,7 +666,8 @@ class UwNodeFieldValue {
...
@@ -670,7 +666,8 @@ class UwNodeFieldValue {
// Get the link field from the node.
// Get the link field from the node.
$link
=
$node
->
field_uw_author_link
->
getValue
();
$link
=
$node
->
field_uw_author_link
->
getValue
();
$author
[
'name'
]
=
$author_name
;
// Get the auther name from the node.
$author
[
'name'
]
=
$node
->
field_author
->
value
;
if
(
!
empty
(
$link
))
{
if
(
!
empty
(
$link
))
{
$author
[
'link'
]
=
$link
[
0
][
'uri'
];
$author
[
'link'
]
=
$link
[
0
][
'uri'
];
...
...
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