If a view has exposed filters, and those filters have options selected before a bulk operation is performed, those selections are forgotten after the operation(s) is performed.

Comments

infojunkie’s picture

Assigned: Unassigned » infojunkie
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)
jdidelet’s picture

Version: » 6.x-1.x-dev
Component: Code » Core
Assigned: infojunkie » Unassigned

Hi,

I have a bug who is the same type of this bug. Now after bulk operation, I keep my filter selection when I come back to my view page. But if my view (where I come back) has multiple pages and if I go on the second page, I lose my filter selection. I tested with the last version of vbo (6.x-1.x-dev).

jdidelet’s picture

Status: Closed (fixed) » Active
infojunkie’s picture

Do you mean that your exposed filters are marked with "Remember the last settings" ? I wasn't able to reproduce this on my testing machine. Do you have a demo installation I can see?

jdidelet’s picture

Version: 6.x-1.x-dev » 6.x-1.9

Hi,

Sorry to come back only now. I created a test website for demo. You can go to http://sphk.fr/ and login with demo/demo (for login/password). After, click on "Page test VBO" in the menu at the left.
Here the process for reproduce the bug (I tested with drupal 6.15, views 2.8 and VBO 1.9):
-> Type "muswusip" value in the "Taxoxomy: Term ID (with depth): field" and apply the filter. You'll have 3 pages of results.
-> Check the checkbox on two (or more) nodes and apply "Unpublish post" action.
-> As you can see, you'll come back to your view page with the "Taxoxomy: Term ID (with depth): field" who remember my value (here: "muswusip"). You'll have always 3 pages of results. Here ok no problem.

Here is the bug.
-> Now click on page "2" or page "Next". As you can see, I lose my filter value and the number of pages is not 3 but more.

I copy/paste my view code below.

$view = new view;
$view->name = 'test_vbo';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Title',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => 'All terms',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'type' => 'separator',
    'separator' => ', ',
    'link_to_taxonomy' => 1,
    'limit' => 1,
    'vids' => array(
      '1' => 1,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
  ),
  'status' => array(
    'label' => 'Published',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'type' => 'yes-no',
    'not' => 0,
    'exclude' => 0,
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'story' => 'story',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'term_node_tid_depth' => array(
    'operator' => 'or',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'term_node_tid_depth_op',
      'identifier' => 'term_node_tid_depth',
      'label' => 'Taxonomy: Term ID (with depth)',
      'optional' => 1,
      'single' => 1,
      'remember' => 1,
    ),
    'type' => 'textfield',
    'limit' => TRUE,
    'vid' => '1',
    'depth' => '3',
    'id' => 'term_node_tid_depth',
    'table' => 'node',
    'field' => 'term_node_tid_depth',
    'hierarchy' => 0,
    'relationship' => 'none',
    'reduce_duplicates' => 0,
  ),
));
$handler->override_option('access', array(
  'type' => 'role',
  'role' => array(
    '2' => 2,
    '3' => 3,
  ),
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'bulk');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 1,
  'order' => 'asc',
  'columns' => array(
    'title' => 'title',
    'tid' => 'tid',
    'status' => 'status',
  ),
  'info' => array(
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'tid' => array(
      'separator' => '',
    ),
    'status' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
  'execution_type' => '2',
  'display_type' => '0',
  'hide_select_all' => 0,
  'skip_confirmation' => 1,
  'display_result' => 1,
  'merge_single_action' => 0,
  'selected_operations' => array(
    'node_publish_action' => 'node_publish_action',
    'node_unpublish_action' => 'node_unpublish_action',
    'node_assign_owner_action' => 0,
    'views_bulk_operations_delete_node_action' => 0,
    'node_mass_update:a27b9efabcd054685a549378b174ad11' => 0,
    'system_message_action' => 0,
    'views_bulk_operations_action' => 0,
    'views_bulk_operations_script_action' => 0,
    'node_make_sticky_action' => 0,
    'node_make_unsticky_action' => 0,
    'node_mass_update:c4d3b28efb86fd703619a50b74d43794' => 0,
    'views_bulk_operations_taxonomy_action' => 0,
    'views_bulk_operations_argument_selector_action' => 0,
    'node_promote_action' => 0,
    'node_mass_update:14de7d028b4bffdf2b4a266562ca18ac' => 0,
    'node_mass_update:9c585624b9b3af0b4687d5f97f35e047' => 0,
    'system_goto_action' => 0,
    'node_unpromote_action' => 0,
    'node_mass_update:8ce21b08bb8e773d10018b484fe4815e' => 0,
    'node_save_action' => 0,
    'system_send_email_action' => 0,
    'node_mass_update:0ccad85c1ebe4c9ceada1aa64293b080' => 0,
    'node_unpublish_by_keyword_action' => 0,
  ),
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'test-vbo');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));

Regards and thanks for your help !

infojunkie’s picture

Sorry for getting back to you so late. I've checked your site and things to be working correctly, but without the confirmation page. Is it also working with the confirmation page enabled?

jdidelet’s picture

Sorry to getting back to you so late too :). You mean you always have 3 pages when you click on page 2 or "Next" (after you realize the operation)? Strange, in my computer, when I click on "Next" after I realize "Publish" Operation, I have more than 3 pages... Not good. Can you send me a screenshot of your result when you click on "Next" after you realize a bulk operation (publish or unpublish) ? Perhaps it's me...
Thanks in advance,

infojunkie’s picture

Can you try a normal (non-VBO) view with the "Remember" setting on the same exposed filter? I just want to make sure this is not a Views issue.

jdidelet’s picture

I paramater a non-vbo view (table view) and as you can see, the result is ok. No bug from Views. Please test and tell me if you have the same result than me.

infojunkie’s picture

Can you please put back the VBO in http://sphk.fr/test-vbo ? I forgot what I'm trying to check :-)

jdidelet’s picture

No problem :). It's done.

infojunkie’s picture

StatusFileSize
new112.27 KB
new102.09 KB

Sorry, but it seems VBO is working correctly. Attached are the screenshots for the 2 stages (couldn't catch the progress bar).

jdidelet’s picture

I'm sorry but perhaps my english is not clear. The problem is not VBO action. The result is ok. It's after you've done the update. As you can see in Step2, you have 3 pages. Now, after the step2, try to click on "Next >" value (in the pagination). As you can see, the number of pages will not be 3 but more.

jdidelet’s picture

StatusFileSize
new125.83 KB
new112.69 KB
new100.03 KB

I publish 3 screenshots here. Perhaps it will be more clear.

Thanks for your help.

infojunkie’s picture

I understand now. This doesn't occur on my test machine, but I'm using different exposed filters.

Can you please try with a taxonomy drop-down and see if there's a difference?

smuthu’s picture

Priority: Normal » Critical

I am also facing the same issue the user (jdidelet) faced pagination is not working and sorting also not working properly with exposed filter.

infojunkie’s picture

Priority: Critical » Normal
jdidelet’s picture

StatusFileSize
new127.68 KB
new128.48 KB
new112.95 KB

It's done but the result is the same. You can try. I changed by a dropdown. I attached step 1, step 2 and step 3.

infojunkie’s picture

This only occurs with Ajax on. Can you confirm?

jdidelet’s picture

yes I tested. If you disable ajax form (Use Ajax = No in Views), it's ok. Do I need to create a ticket in Views issue?

infojunkie’s picture

No please keep it here. I need to investigate this more.

robby.smith’s picture

subscribing

fatstar415’s picture

subscribing

verta’s picture

Subscribing.

The exposed filter works, but I cannot figure out how to disable it. I am filtering on a role, fine, but now I want to no longer filter. Since it's cached, I can't unselect it. Any advice?

Edit: Found it.

Ctrl-Click. First I found two other lost souls whom nobody would help (and I posted an answer for both of them), then I found Better_Exposed_Filters http://drupal.org/project/better_exposed_filters because it was discussing the exposed filter UI.

Try telling a client that they should click on an option, then scroll to the next option and ctrl+click on it. Don't just click 'cause you'll lose your first selection. Oh, and ctrl+click again to unselect an option... Yeah, not user friendly.

bojanz’s picture

Status: Active » Closed (fixed)

A lot of changes got committed to VBO in order to handle this better, since this issue was last active.
Reopen the issue if there is still a problem (with 6.x-1.x-dev or 6.x-1.11-beta1).