Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
a45b6488
Commit
a45b6488
authored
Jul 24, 2010
by
Dries
Browse files
- Patch
#643656
by sun: comment 'Save' button disappears on form validation error.
parent
a6f79394
Changes
1
Show whitespace changes
Inline
Side-by-side
modules/comment/comment.module
View file @
a45b6488
...
...
@@ -1944,14 +1944,12 @@ function comment_form($form, &$form_state, $comment) {
$form
[
'node_type'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
'comment_node_'
.
$node
->
type
);
// Only show the save button if comment previews are optional or if we are
// already previewing the submission. However, if there are form errors,
// we hide the save button no matter what, so that optional form elements
// (e.g., captchas) can be updated.
// already previewing the submission.
$form
[
'actions'
]
=
array
(
'#type'
=>
'actions'
);
$form
[
'actions'
][
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Save'
),
'#access'
=>
(
$comment
->
cid
&&
user_access
(
'administer comments'
))
||
variable_get
(
'comment_preview_'
.
$node
->
type
,
DRUPAL_OPTIONAL
)
!=
DRUPAL_REQUIRED
||
(
!
form_get_errors
()
&&
isset
(
$form_state
[
'comment_preview'
])
)
,
'#access'
=>
(
$comment
->
cid
&&
user_access
(
'administer comments'
))
||
variable_get
(
'comment_preview_'
.
$node
->
type
,
DRUPAL_OPTIONAL
)
!=
DRUPAL_REQUIRED
||
isset
(
$form_state
[
'comment_preview'
]),
'#weight'
=>
19
,
);
$form
[
'actions'
][
'preview'
]
=
array
(
...
...
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