Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
12371593
Commit
12371593
authored
Nov 16, 2006
by
Neil Drumm
Browse files
#87474
by webernet. Move the log message field from book to node module.
parent
b4faaa3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/book/book.module
View file @
12371593
...
...
@@ -232,13 +232,6 @@ function book_form(&$node) {
);
$form
[
'body_filter'
][
'format'
]
=
filter_form
(
$node
->
format
);
$form
[
'log'
]
=
array
(
'#type'
=>
'textarea'
,
'#title'
=>
t
(
'Log message'
),
'#weight'
=>
5
,
'#description'
=>
t
(
'An explanation of the additions or updates being made to help other authors understand your motivations.'
),
);
if
(
user_access
(
'administer nodes'
))
{
$form
[
'weight'
]
=
array
(
'#type'
=>
'weight'
,
'#title'
=>
t
(
'Weight'
),
...
...
modules/node/node.module
View file @
12371593
...
...
@@ -571,12 +571,18 @@ function node_save(&$node) {
// Split off revisions data to another structure
$revisions_table_values
=
array
(
'nid'
=>
$node
->
nid
,
'vid'
=>
$node
->
vid
,
'title'
=>
$node
->
title
,
'body'
=>
$node
->
body
,
'teaser'
=>
$node
->
teaser
,
'log'
=>
$node
->
log
,
'timestamp'
=>
$node
->
changed
,
'teaser'
=>
$node
->
teaser
,
'timestamp'
=>
$node
->
changed
,
'uid'
=>
$user
->
uid
,
'format'
=>
$node
->
format
);
$revisions_table_types
=
array
(
'nid'
=>
'%d'
,
'vid'
=>
'%d'
,
'title'
=>
"'%s'"
,
'body'
=>
"'%s'"
,
'teaser'
=>
"'%s'"
,
'log'
=>
"'%s'"
,
'timestamp'
=>
'%d'
,
'teaser'
=>
"'%s'"
,
'timestamp'
=>
'%d'
,
'uid'
=>
'%d'
,
'format'
=>
'%d'
);
if
(
!
empty
(
$node
->
log
))
{
// Only store the log message if there's something to store; this prevents existing
// log messages from being unintentionally overwritten by a blank message.
$revisions_table_values
[
'log'
]
=
$node
->
log
;
$revisions_table_types
[
'log'
]
=
"'%s'"
;
}
$node_table_values
=
array
(
'nid'
=>
$node
->
nid
,
'vid'
=>
$node
->
vid
,
'title'
=>
$node
->
title
,
'type'
=>
$node
->
type
,
'uid'
=>
$node
->
uid
,
'status'
=>
$node
->
status
,
'created'
=>
$node
->
created
,
...
...
@@ -1955,6 +1961,18 @@ function node_form($node, $form_values = NULL) {
}
$form
[
'#node'
]
=
$node
;
// Add a log field if the "Create new revisions" option is checked, or if the
// current user has the ability to check that option.
if
(
$node
->
revision
||
user_access
(
'administer nodes'
))
{
$form
[
'log'
]
=
array
(
'#type'
=>
'textarea'
,
'#title'
=>
t
(
'Log message'
),
'#rows'
=>
2
,
'#weight'
=>
20
,
'#description'
=>
t
(
'An explanation of the additions or updates being made to help other authors understand your motivations.'
),
);
}
// Node author information for administrators
$form
[
'author'
]
=
array
(
'#type'
=>
'fieldset'
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment