Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
View form is making issues when some module implements hook_menu_alter() and relocate the menu entry that is of a particular views display.
Here is the make file to produce environment with this issue:
core = 7.x api = 2 ; Core projects[drupal][version] = "7.39" ; Modules projects[views_bulk_operations][version] = "3.3" projects[admin_views][version] = "1.5" projects[ctools][version] = "1.9" projects[entity][version] = "1.6" projects[file_entity][version] = "2.0-beta2" projects[media][version] = "2.0-beta1" projects[media_browser_plus][version] = "3.0-beta3" projects[multiform][version] = "1.1" projects[views][version] = "3.11" projects[views_tree][version] = "2.0"
- Install 'media_browser_plus' module.
- Create one or more file entities using path 'file/add'. We are going to try deleting them using VBO.
- Go to path 'admin/content/file/list' and select one or more files.
- From 'Operations', select 'Delete' and press 'Execute'.
- You will get directed to path 'admin/content/file' instead of showing delete confirmation for VBO and that is the issue
Comment | File | Size | Author |
---|---|---|---|
#2 | views_take_current_path_for_form_action-2565899-2.patch | 488 bytes | junaidpv |
Comments
Comment #2
junaidpvIn my above example it happens because media_browser_plus module menu alters path of 'admin_views_file' views from 'admin/content/file' to 'admin/content/file/list' and views form generation still sets 'admin/content/file' as forms action path.
Here is the simple patch that remove lines that set #action property of form manually. Will it make any further problems?
Even with this given patch, it will not get properly redirected back to original page after VBO. That is because similar issue in VBO module. Here is the change correcting that part:
Please provide your valuable inputs to this.
Comment #3
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 3 year old patch in #2 to views.module applied cleanly to the latest views 7.x-3.x-dev and if still relevant needs to be reviewed.