Сondition:
- table layout;
- use grouping field.

If I check checkbox "select all" in one group of node, then all nodes on page selected. I think it is incorrect action (?). In old version 3.x-dev it's work fine - selected only nodes in group.

Comments

bojanz’s picture

Category: feature » bug

True, it's a bit shaky currently.

bojanz’s picture

The question here is how to handle the row that allows you to switch between "select all on this page" and "select all on all pages".
Remove the option to select everything across all pages? Do the row show/hide on every table (group)? Needs some thought. How did old 7.x-3.x handle this?

I think the best option would be to kill that row, and show the same thing you get with a grid view, the box above the results allowing you to select all on the page / on all pages. And have the table checkbox just do the selecting in that particular table.

valante’s picture

I also need a solution for this. Here's my logic for a grouped view.

Layout:

[1] Select all rows

[2] Group 1
    [3] Row 1
    [4] Row 2

[5] Group 3
    [6] Row 4
    [7] Row 5

Some terms to make life easier:

Top-level checkbox: [1]
Group-level checkboxes: [2], [5]
Row-level checkboxes: [3], [4], [6], [7]
Selection type: the value of "this page" / "all pages" row

Overview:

  • Using the top-level selection is the same as using all group-level checkboxes with the same selection type.
  • The top-level selection (if checked) should always be synchronized with the group- and row-level selections below.
  • Using the group-level selection is the same as using all row-level checkboxes under that group.

Detailed behavior:

  • Checking the top-level box:
    • Check all row-level boxes on this page.
    • Check all group-level boxes on this page.
    • Display "this page"/"all pages" option row below the top-level box.
    • Display "this page"/"all pages" option row below all group-level boxes.
    • Assign the top-level selection type to all group-levels.
  • Changing the top-level selection type:
    • Changing the top-level selection type affects rows of all groups.
    • Changing the top-level selection type updates the selection type display below every group-level box.
  • Unchecking the top-level box:
    • Uncheck all rows in all groups.
    • Hide all "this page"/"all pages" option rows in each group
    • Hide the top-level "this page"/"all pages" option row
  • Checking a group-level box:
    • Check all row-level items under this group only.
    • Display "this page"/"all pages" option row below the group-level box.
  • Changing the group-level selection type:
    • Selection type affects rows of this group only.
    • If top-level box is checked, uncheck it (while keeping all group-level and row-level checks). This, to indicate the synchronization between the top level and the groups is broken.
  • Unchecking the group-level box:
    • Uncheck all row-level items under this group only.
    • If top-level box is checked, uncheck it (while keeping all other group-level and row-level checks).
  • Unchecking the row-level box:
    • If top-level box is checked, uncheck it (while keeping all other group-level and row-level checks).
    • If the item's group-level box is checked, uncheck it (while keeping all other row-level checks in the group).





That's it, I think. I hope this makes sense :-)

bojanz’s picture

Great analysis valante, I appreciate your thoughts. Thinking the same, except that the top-level box should also have an option to select acros all pages (same widget as when using VBO on a grid view, for example).
Shouldn't take much work, all the pieces are already there, they just need to be tweaked a bit, with a sacrifice to the JS gods.

valante’s picture

I'll go find a big, fat bull then :-)

bojanz’s picture

Title: Grouping nodes and incorrect action "select all" in one group » Incorrect 'select all on this page / all pages' for grouped table displays.
Status: Active » Fixed

Committed a fix: http://drupalcode.org/project/views_bulk_operations.git/commitdiff/11523...

Give it a test and let me know if I missed anything. Spare the bull for now :)

valante’s picture

LOL, you have eternal bovine gratitude.

Ran a preliminary test and it seems to work fine, except for one thing. When a row- or group-level box is unchecked, the change doesn't propagate upwards as it should.

BTW, I could not apply the diff to the beta branch, so I installed the dev version. Is it safe to use in production sites? And if not, is there any chance of committing this fix to the beta branch?

EDIT: The 18% width in .vbo-fieldset-select-all causes the 'select all' text to break over two lines. Please change?

bojanz’s picture

There is no beta branch, a beta is just a snapshot of the 7.x-3.x branch (from which -dev is generated each night) at a certain point in time.
Since beta1 I've only committed small fixes, so -dev is perfectly fine for production (7.x-3.x has settled into calm waters mostly).

When a row- or group-level box is unchecked, the change doesn't propagate upwards as it should.

True, never crossed my mind. It's really minor though. Will give it a fix.

EDIT: The 18% width in .vbo-fieldset-select-all causes the 'select all' text to break over two lines. Please change?

Which value do you recommend?

valante’s picture

@bojanz, thanks for clearing up on the beta/dev issue. I'm not very fluent in GIT.

As for the width value, I guess it really depends on the theme. For me (under the default installation theme), 25% is a good but tight fit. Maybe 30% would be playing it safer.

And if we're talking aesthetics, the text ends up aligned almost to the bottom because of the 25px margin-top in .fieldset-wrapper. Eh, I'm a perfectionist, what can I say.

bojanz’s picture

Status: Fixed » Needs work

Okay, since there are tweaks that can be done, updating the issue status.

bojanz’s picture

Wow, I had no idea that the "select all" widget looked that broken in Bartik / Garland / Stark. Made it sane:
http://drupalcode.org/project/views_bulk_operations.git/commitdiff/e75e4...
http://drupalcode.org/project/views_bulk_operations.git/commitdiff/f4480...
Still don't like the fact that I need !important in there, but it works.

bojanz’s picture

valante’s picture

Not sure what I'm doing this time, but I've installed the latest dev version and I don't see any difference in behavior from #6 above.

valante’s picture

Status: Fixed » Needs work

Ignore my #13, it was an unfortunate brain-fart.

I've installed the new dev and I see the changes. Here they are:

1. No top-level select box at all.
2. When I click any group-level select box, it toggles all row-level boxes (but not the other group-level boxes).
3. Unchecking a row-level box does not effect its parent group-level box.
4. No "this page"/"all pages" controls ever appear.

All in all, #6 was closer to the mark.

bojanz’s picture

Are you sure you didn't install the beta by mistake? That doesn't sound like -dev to me. Please check, just in case.
Also, clear your cache, my changes after #6 were all to CSS and JS, if you're aggregating them, you might not see them without a cache clear.

valante’s picture

Status: Needs work » Fixed

Amazing, two brain-farts in a row.

Sorry, bojanz! Remind me not to build sites when I'm hardly conscious :-)

The new commit works like a charm. I'm still not getting the "this page"/"all pages" line, but probably because I don't have more than one page in the only VBO view I currently have.

bojanz’s picture

Yes, it won't show if you only have one page. Glad to know it works now :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Musa.thomas’s picture

Version: 7.x-3.x-dev » 6.x-1.15
Status: Closed (fixed) » Active

I've got this issue with Drupal 6 and views 6.30

bojanz’s picture

Version: 6.x-1.15 » 7.x-3.x-dev
Status: Active » Closed (fixed)

There's already an issue for the D6 version here: #1598458: Selecting group executes action on all rows.
That said, you'll have to supply a patch yourself, VBO for D6 is in maintenance mode.