Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
221
Merge Requests
221
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
fea41b63
Commit
fea41b63
authored
Jun 03, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#468630
by Berdir: fixed error with publishing comments.
parent
2ad42112
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
modules/comment/comment.api.php
modules/comment/comment.api.php
+6
-6
modules/comment/comment.module
modules/comment/comment.module
+2
-1
modules/comment/comment.test
modules/comment/comment.test
+1
-1
modules/search/search.module
modules/search/search.module
+2
-2
No files found.
modules/comment/comment.api.php
View file @
fea41b63
...
...
@@ -62,7 +62,7 @@ function hook_comment_update($form_values) {
* @return
* Nothing.
*/
function
hook_comment_view
(
&
$comment
)
{
function
hook_comment_view
(
$comment
)
{
// how old is the comment
$comment
->
time_ago
=
time
()
-
$comment
->
timestamp
;
}
...
...
@@ -71,12 +71,12 @@ function hook_comment_view(&$comment) {
* The comment is being published by the moderator.
*
* @param $form_values
* Passes in
an array of form values submitted by the user
.
* Passes in
the comment the action is being performed on
.
* @return
* Nothing.
*/
function
hook_comment_publish
(
$
form_values
)
{
drupal_set_message
(
t
(
'Comment: @subject has been published'
,
array
(
'@subject'
=>
$
form_values
[
'subject'
]
)));
function
hook_comment_publish
(
$
comment
)
{
drupal_set_message
(
t
(
'Comment: @subject has been published'
,
array
(
'@subject'
=>
$
comment
->
subject
)));
}
/**
...
...
@@ -87,7 +87,7 @@ function hook_comment_publish($form_values) {
* @return
* Nothing.
*/
function
hook_comment_unpublish
(
&
$comment
)
{
function
hook_comment_unpublish
(
$comment
)
{
drupal_set_message
(
t
(
'Comment: @subject has been unpublished'
,
array
(
'@subject'
=>
$comment
->
subject
)));
}
...
...
@@ -99,7 +99,7 @@ function hook_comment_unpublish(&$comment) {
* @return
* Nothing.
*/
function
hook_comment_delete
(
&
$comment
)
{
function
hook_comment_delete
(
$comment
)
{
drupal_set_message
(
t
(
'Comment: @subject has been deleted'
,
array
(
'@subject'
=>
$comment
->
subject
)));
}
...
...
modules/comment/comment.module
View file @
fea41b63
...
...
@@ -948,7 +948,8 @@ function comment_save($edit) {
}
else
{
drupal_set_message
(
t
(
'Your comment has been posted.'
));
comment_invoke_comment
(
$edit
,
'publish'
);
$comment
=
(
object
)
$edit
;
comment_invoke_comment
(
$comment
,
'publish'
);
}
return
$edit
[
'cid'
];
...
...
modules/comment/comment.test
View file @
fea41b63
...
...
@@ -7,7 +7,7 @@ class CommentHelperCase extends DrupalWebTestCase {
protected
$node
;
function
setUp
()
{
parent
::
setUp
(
'comment'
);
parent
::
setUp
(
'comment'
,
'search'
);
// Create users.
$this
->
admin_user
=
$this
->
drupalCreateUser
(
array
(
'administer content types'
,
'administer comments'
,
'administer permissions'
,
'administer blocks'
));
$this
->
web_user
=
$this
->
drupalCreateUser
(
array
(
'access comments'
,
'post comments'
,
'create article content'
));
...
...
modules/search/search.module
View file @
fea41b63
...
...
@@ -690,9 +690,9 @@ function search_comment_delete($comment) {
/**
* Implement hook_comment_publish().
*/
function
search_comment_publish
(
$
form_values
)
{
function
search_comment_publish
(
$
comment
)
{
// Reindex the node when comments are published.
search_touch_node
(
$
form_values
[
'nid'
]
);
search_touch_node
(
$
comment
->
nid
);
}
/**
...
...
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