Skip to content

Adminhtml: Filter issues with grids using GET in combination with Reset Filter button #1020

Description

@tmewes

Description

There are some issues with adminhtml grids using GET ($this->setUseAjax(false); or the line is missing entirely) instead of POST ($this->setUseAjax(true);). The Payment Restrictions grid is a good example.

Steps to reproduce

  • Open Sales > Payment Restrictions in adminhtml
  • Ensure you have at least one payment restriction (add one if needed)
  • Check the url in the grid: Should be something like /admin/payment_restriction/index/key/123123123123123123/
  • Filter the column name for the value test
  • Check the url again: Should be something like admin/payment_restriction/index/key/123123123123123123/page/1/filter/bmFtZT10ZXN0JmNyZWF0ZWRfYXQlNUJsb2NhbGUlNUQ9ZGVfREU%3D/internal_restriction//form_key/hkc5ekHhVgwKdY6K/ and notice the // (empty param/value) in the url
  • Click on Reset Filter
  • Check the url again: Should be something like admin/payment_restriction/index/key/123123123123123123/page/1/filter//internal_restriction/form_key/form_key/hkc5ekHhVgwKdY6K/
  • In one line of the grid, click on a massaction checkbox
  • Select Change status and Status Disabled in the massaction select elements
  • Click on Submit
  • You will be redirected to the dashboard page and get the following error message:
Image

Currently, using POST isn't mandatory so we could either fix this issue for grids using GET or $this->setUseAjax(true); should globally be the only supported way for grids.

Related Code

  • lib/Maho/Routing/ControllerDispatcher.php starting at line 105
Image
  • public/js/mage/adminhtml/grid.js
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions