ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 7 replies, has 2 voices, and was last updated by Hiro Hiro 2 years, 5 months ago.

  • Creator
    Topic
  • #5465
    Hiro
    Hiro
    Participant

    I have noticed Mass Action request does not seem to send the parameter that we can apply to the DQL for the data grid.

    What do I have to do to send the request with a parameter?
    Can we make that happen by putting extra parameter to dataGrid.renderGrid()?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #5687

    Alexandr Smaga
    Participant

    Hello @hiro-ifactory!

    Not sure that I understand you correctly.. Mass action request URI should include all params that comes to renderGrid, are they there ?

    #5689
    Hiro
    Hiro
    Participant

    Thank you for the reply.

    So I need to delete multiple records from a data grid and the query in datagrid.yml file has multiple parameters like “:param_1”, “:param_2″…

    The data grid is generated like:

    According to my FireBug it does not send those parameters when mass action is executed as the request URL is like this (as not including the parameters “param_1”, “param_2″…):

    And I am actually not sure if I have to send “param_X” because technically I do not need them to delete a record as the request URL is sending the id with the query “values”.

    And I am guessing I have to send the parameters to make DQL work for the data grid after having a look at the classes:
    Oro\Bundle\DataGridBundle\Extension\MassAction\MassActionDispatcher
    and
    Oro\Bundle\DataGridBundle\Extension\MassAction\DeleteMassActionHandler

    When I dump $results for the data grid using a parameter, count($results) is zero so that later “foreach” does not happen.

    And frontend gets this:

    What do I have to do to enable a data grid to execute Delete Mass Action when the data grid uses the parameter?

    #5690
    Hiro
    Hiro
    Participant

    In addition to the issue, I have created my own Listener class so that my data grid can refer multiple parameters.

    https://gist.github.com/hiro-iFactory/ac273c8a043a8f82d878

    #5692

    Alexandr Smaga
    Participant

    Yes I got you!

    Seems that this is a bug in “mass actions”, because all params that grid needs in order to fetch data is also required for mass action. We do no send all checked IDs for mass action we only send a selected and unselected arrays in special syntax in order to be able to remove thousands of records by single request.

    We will investigate it and will keep you posted. Thank you!

    #5740
    Hiro
    Hiro
    Participant

    Thank you!

    #6715
    Hiro
    Hiro
    Participant

    Has this issue been amended?

    #6724
    Hiro
    Hiro
    Participant

    I ended up creating a custom Mass Action that skips creating $results.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.