Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diff-2935391
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
diff-2935391
Commits
5e395e7e
Commit
5e395e7e
authored
16 years ago
by
Moshe Weitzman
Browse files
Options
Downloads
Patches
Plain Diff
#175663
Get correct node field titles from node type.
parent
02b76bad
No related branches found
Branches containing commit
Tags
8.x-1.0-alpha4
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
node.inc
+10
-6
10 additions, 6 deletions
node.inc
with
10 additions
and
6 deletions
node.inc
+
10
−
6
View file @
5e395e7e
...
...
@@ -5,19 +5,23 @@
* Implementation of hook_diff() for node.module (body and title).
*/
function
node_diff
(
&
$old_node
,
&
$new_node
)
{
$result
=
array
();
$type
=
node_get_types
(
'type'
,
$new_node
);
$result
[]
=
array
(
'name'
=>
t
(
'Title'
)
,
'name'
=>
$type
->
title_label
,
'old'
=>
array
(
$old_node
->
title
),
'new'
=>
array
(
$new_node
->
title
),
'format'
=>
array
(
'show_header'
=>
false
,
)
);
$result
[]
=
array
(
'name'
=>
t
(
'Body'
),
'old'
=>
explode
(
"
\n
"
,
$old_node
->
body
),
'new'
=>
explode
(
"
\n
"
,
$new_node
->
body
),
);
if
(
$type
->
has_body
)
{
$result
[]
=
array
(
'name'
=>
$type
->
body_label
,
'old'
=>
explode
(
"
\n
"
,
$old_node
->
body
),
'new'
=>
explode
(
"
\n
"
,
$new_node
->
body
),
);
}
return
$result
;
}
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