this patch adds the same filtering mechanism that's already available at admin/user/user and admin/content/node. it seems to me we should have the same basic layout for all three of those admin screens, for consistency. the patch eliminates the secondary tabs, as they are no longer necessary -- simply filter the comments by status to see all unpublished comments.

test site here: http://test.xcarnated.com

Comments

hunmonk’s picture

one note: i wasn't able to figure out the CSS to properly float the filter buttons as they are on the other admin pages, so i've temporarily punted and just put them below the filter options. :) i would appreciate it if a CSS wizard could fix that up!

add1sun’s picture

really nice stuff. i agree that a consistent UI would be a Good Thing (tm). +1

yched’s picture

On the test site, publishing / unpublishing comments produce white screens

michelle’s picture

+1 from me. This would be awesome to have on d.o. Currently deleting comment spams is a manual job because there's no way to filter the comment admin screen by user name.

Michelle

hunmonk’s picture

StatusFileSize
new13.39 KB

couple of updates:

  1. fixed the white screen -- bad function call.
  2. made the status terms/capitalization consistent w/ the layout at admin/content/node.
  3. restored the filter button layout to the same as admin/content/node.

the one remaining problem that i see is to fix the layout issue with the filter buttons. i'm no CSS guru, so somebody else please step up to help!

test site here: http://test.xcarnated.com

hunmonk’s picture

StatusFileSize
new13.39 KB

ok, the button overlap is caused by a fixed width setting in system.module:

system.css: line 158, there is a width:14em applied to dl.multiselect dd.b select

all the other admin filters use this setting, so it seems most sensible to just back off the width of the user autocomplete field to fix the issue.

attached patch corrects.

hunmonk’s picture

StatusFileSize
new13.82 KB

hunmonk: Steef: i checked IE 6, and the only difference i see when removing the width: 14em; line is that it throws the buttons below the filter list

hunmonk: Steef: i think this is fine, given it's still an ok layout, and all the others work as they are supposed to -- thoughts?

Steef: hunmonk: yes, include it in your patch

so attached patch restores the original length of the user textfield, and bags the fixed width CSS line...

hunmonk’s picture

Title: filtering for admin/content/comment » make admin'ing comments like admin'ing nodes
StatusFileSize
new17.63 KB

this update completes the comment admin interface conversion to be consistent with the node admin interface:

  • adds hook_comment_operations(), which functions just like hook_node_operations().
  • some custom additions to allow filtering by the anonymous user -- this was necessary due to the funky way the anon user is handled in core.
dmitrig01’s picture

Status: Needs review » Reviewed & tested by the community

It's all good!
I did code review, tests came out definite positive
I reviewed the patch on hunmonk's test site for about 7 minutes and I found no errors, except for

user is thehunmonkgroup
and where user is test

which is present in all core filters :x
But besides that, it is rtbc!

jvandyk’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new17.76 KB

The filter worked fine, except for status = published. That was failing because if ($form_state['values'][$filter]) fails when the value of $filter is 0, as it is when the 'published' option is selected in the dropdown. Changed the test to isset() and it works.

Refine works. Undo works. Reset works.

Changed 'user' to 'author' in the filter. It should either be that or 'username', otherwise it's not clear what to type in the autocomplete textfield. I went with author because that is the title of the column in the comment table below, so it's consistent.

Also fixed the funky array formatting.

This is a very helpful patch and makes Drupal more consistent.

webchick’s picture

Status: Needs review » Needs work
StatusFileSize
new10.34 KB

Hm. I'm getting the depicted weird output, in Camino, Firefox, and Safari. I tried shift+reload but even in new browser instances it happened.

And if this is truly about making the admin/content/comment and admin/content/node screens identical, that very handy author option ought to be on the node administration thing too.

hunmonk’s picture

Assigned: hunmonk » Unassigned

it would be great if somebody else could pick this up and bring it home -- it's a needed usability improvement.

pancho’s picture

Version: 6.x-dev » 7.x-dev

We need to pick this up and bring it home - to D7, unfortunately.

dave reid’s picture

Title: make admin'ing comments like admin'ing nodes » Add hook_comment_operations()

I might pick this up. It's sorely needed and we need to stop hard-coding the #$^@ comment operations. :)

dave reid’s picture

Title: Add hook_comment_operations() » Revise comment admin interface like content admin, add hook_comment_operations()
sun’s picture

Priority: Normal » Critical

#355926: Add comment_mass_update() was marked as duplicate of this issue. If it really is (I did not check), then this issue is critical, because the other is. If you revert to normal, then this issue is not a duplicate and the other needs to be re-opened.

dave reid’s picture

Issue tags: +Mollom, +DrupalWTF

Cross-tagging for core issues that need to be fixed for the Mollom.module.

sun’s picture

Category: feature » task
Issue tags: +API clean-up

Tagging for feature freeze.

sun.core’s picture

Priority: Critical » Normal

This would still be nice to get in, 'cause those half-baked comment_operations functions are totally insane to work with... if webchick agrees, then perhaps someone manages to do this until 15th.

At the very least, not critical.

sun.core’s picture

Version: 7.x-dev » 8.x-dev
jhedstrom’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

This should be a bit easier now that this page is a view (I think?).

miro_dietiker’s picture

We realised that hook_entity_operation_alter() is not triggered for comments when implementing that hook in collect module #2491307: Add "Capture" operation to all content entities.
Currently the operations are hardcoded in CommentAdminOverview::buildForm().

A similar limitation still exists in D8 with terms and a solution: #2469567: Entity operations for terms are hardcoded in taxonomy terms's overview page

Retitling the issue to refer to hook_entity_operation_alter()?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andypost’s picture

Version: 8.8.x-dev » 9.1.x-dev

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.