backdrop / backdrop-issues

Issue tracker for Backdrop core.
145 stars 40 forks source link

VBO: Allow bulk enabling/disabling comments on existing content. #2297

Open wesruv opened 8 years ago

wesruv commented 8 years ago

This is part of #3797

In #764 we moved the "Hidden" option for comments from the content type level to the node level. So if one wants to achieve the previous functionality (for example to set the comments for all content of a specific content type to hidden), then the only way to do it would be to filter content by this content type and then set their comments to hidden en masse. But we don't have such an option available. Let's provide this VBO then.

Here's a rundown of the problem:

Item from BAD Camp training, probably in VBO

klonos commented 8 years ago

Hmm, there's quite a few articles out there with people requesting the same thing and there seem to always be the same two answers:

a) manually run a UPDATE node SET comment = 0 WHERE type LIKE "content_type"; SQL query against the db., changing the 0 part with the appropriate value (0, 1 or 2, see below).

b) Use the "Change value" option available in VBO...

  1. Create a view of content and add a bulk operations field to it. In the "Selected Bulk Operations" section, select the "Modify entity values" option. Further down in the "Display values" multi-select box under the "Operation settings" section select the "Comments allowed" option:

    d7-vbo-views-modify_entity_values-comments_allowed

  2. Once the view is saved, the way it works on the front-end is that the user selects the "Modify entity values" bulk operation:

    d7-vbo-select_operation_modify_entity_values

    ...then they need to set the value to either 0, 1 or 2 with help text below explaining what each value does:

    d7-vbo-select_value

klonos commented 8 years ago

...I can't even begin listing the usability issues here with both having to figure out how to create the bulk operation as well as the way it then works for the end users 👎

Good thing that our content list is a view already. This way, if we provide such a bulk operation out of the box with the view, people could either clone the view or add a display to it and then tweak it, inheriting the bulk operation for free. No need to figure out how to do it. Win! 👍

Now, with the way that this works, I would expect the last step to be a modal providing a set of radio buttons with the available values instead of asking the user to type in values that don't make sense. So:

klonos commented 8 years ago

Worth mentioning these comments from https://drupal.stackexchange.com/questions/12022/enable-open-comments-on-all-posts-of-a-content-type

In the database, I changed comment=2 for all the records of the content-type, but it did not take effect, I still see comment closed of all those posts in Drupal.

interesting, maybe node_revision has to change as well?. When you open the comments in the UI it works, right? If you have a lot of nodes you could look into VBO (Views Bulk Operation)

Yes, I had to update node_revision table as well. In order to update 'comment' field of this table, it required an SQL statement using 'inner join' clause along with 'node' table since this table does not have 'type' field.

argiepiano commented 1 year ago

This will be possible with the contrib VBO as soon as this is merged into Entity Plus: https://github.com/backdrop-contrib/entity_plus/issues/149

It will be possible to do this in VBO with the action "Modify entity values" - the Comment settings for nodes will show up in the list of properties that's possible to modify.