admin/content/node

# type is Story
# and where status is sticky
# and where status is promoted
# and where status is not sticky
# and where status is not promoted
# and where status is published
# and where status is not published

Not really sure if this is a bug or not, but it doesn't make sense to me to be able to pick filter items that are let you select sticky and not sticky items.

* What are the steps required to reproduce the bug?
select and add each item on the filter list on admin/content/node

* What behavior were you expecting?
the compliment of selected items would no longer be selectable.

* What happened instead?
you can continue to add the compliment item of previously selected items.

Please include as much information as you can:
OS = Windows Vista Business Edition
webserver name and version = Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2
PHP version = PHP Version 4.4.7
Drupal version = 6.0-dev
Drupal path = admin/content/node
and everything else you might feel is relevant
-> MySQL: 5.0.24a
-> No error messages actually popped up, so I guess it's more of a usability issue or a runtime error?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jswaby’s picture

Status: Active » Closed (fixed)

no one seems to care..

jenlampton’s picture

Title: Content page Filter... Usability issue? » Content List page allows opposite - and duplicate status filters
Version: 6.x-dev » 7.x-dev
Status: Closed (fixed) » Active
Issue tags: +D7UX usability
FileSize
64.09 KB

I care, and though it's a usability issue, I belive it is a bug. And it's still present in Drupal 7, so I'm bumping up this issue.

There is also a use case as follows:

# type is Story
# and where status is published
# and where status is published
# and where status is published
# and where status is published
# and where status is published

What should happen:
When someone adds "where status is published" BOTH the published and unpublished items should be removed from the select list. When someone adds "where status is sticky" BOTH the sticky and remove-stickiness options should be removed, etc.

I'd love to spend some time on this, but I'm not sure my jQuery skills are strong enough. :/

caiovlp’s picture

Status: Active » Needs review
FileSize
1.86 KB

Fixed the duplicate filters across the board and the opposite filters for the "status" type only.

Status: Needs review » Needs work
caiovlp’s picture

Status: Needs work » Needs review
FileSize
1.98 KB

Added a isset check. It's weird how those warnings are not being thrown on my machine when I run the unit tests. Hopefully, this will resolve the issue.

dcam’s picture

Issue summary: View changes

Closed #2475255: Search filters admin/content as a duplicate. Also, there may be some duplication in #355820: Improve query filter UI on admin/content .

For the record, this isn't relevant in D8 because the status filter has been narrowed in scope to just the publication status. This was probably done when the content admin page was converted to be a View.

larruda’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the latest patch proposed by @caiovlp under Drupal 7.x-dev and it works just as expected. You can't select opposites to be filtered at the same time. Great work!! Someone please commit this minor bugfix to Drupal core. Thanks!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs work

The patch looks pretty good and seems to work, but:

  1. I think we can/should have automated tests for this.
  2. There are some code style issues including an unused variable ($found), incorrect whitespace, and code comments that go over 80 characters - see https://www.drupal.org/coding-standards
  3. +                  else if ($current_value == $form_state['values'][$filter]) {
    +                    // Unset the current one and add a new one so "Undo" works with the last action
    +                    unset($_SESSION['node_overview_filter'][$index]);
    +                    break;
    +                  }
    

    I couldn't figure out what this is for, since it handles non-"status" filters but none of them should ever be able to reach this code anyway since they don't allow multiple selections. Maybe it's there to fix a theoretical case. At the very least, it seems unrelated to this issue. Am I mistaken?

David_Rothstein’s picture

Actually I also just realized that what @jenlampton recommended in #2 is not implemented here:

When someone adds "where status is published" BOTH the published and unpublished items should be removed from the select list. When someone adds "where status is sticky" BOTH the sticky and remove-stickiness options should be removed, etc.

I think doing it that way would probably be better for usability since it avoids cluttering the select list and allows more of a drill-down approach.

David_Rothstein’s picture

Something like this perhaps?

This could lead to PHP notices after it is applied in the unusual case where a user already has an active set of filters that have duplicates. But that's a pretty big edge case, and the PHP notices would go away the next time the filters are reset (and then never come back).

erickbj’s picture

Patch on #10 works for me against the latest Drupal core dev version.