ssossossosso

Forums

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

This topic contains 6 replies, has 3 voices, and was last updated by  cardiac 1 year, 9 months ago.

  • Creator
    Topic
  • #16254

    cardiac
    Participant

    Hi,

    adding another grid, I am facing another issue:
    I added the more or less default behavior of a delete action to the datagrid.

    When I click on the delete action button, the dialog shows up and when clicking ok the element is deleted in the UI. But after the reload the element is present again.

    So I checked the networking and the delete request won’t be fired. I checked the delete-action.js and checked the URL for the request and it seems to be okay.

    Where to debug next? Why is the delete request missing?

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #16256

    Rodolfo
    Participant

    Hi @cardiac

    1) I would verify if the route exists on your application. If not, double check your routing annotations or yml.

    php app/console debug:route | grep app_api_delete_customerprojectarticle

    2) I would figure out why don’t have ACL parameter for delete action

    3) Since using the browser inspector you don’t see any network request to delete route, I would double check if cleaning cache command are generating the new .js route files.

    4) Also I would add a breakpoint on delete controller action

    #16265

    cardiac
    Participant

    Hi Rodolfo,

    that’s things I checked before, but here are the results:

    1)

    2) I wanted to figure out if ACL is the problem
    Adding (or removing) ACL app_customerprojectarticle_delete makes no difference.

    3) The first thing I do having problems with Oro is a complete platform update.

    3) The delete controller action is not triggered at all. But sure, I added a breakpoint there and see no change

    #16273
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, cardiac.

    If request isn’t triggered from the frontend part – then this is JS issue. Please, check if DeleteAction::doDelete action in delete-action.js really triggers request via model.destroy, and if not – why it happens.

    #16296

    cardiac
    Participant

    I tried to debug the whole thing:

    Logging ModelAction.getLink(): /api/rest/latest/customerprojectarticles/2

    DeleteAction::doDelete is triggered: console.log("Success"); in delete-action.js Line 53, but console.log(this); returns undefined here.

    Logging console.log(this.model); in line 44 of DeleteAction::doDelete:

    I bet there is a check somewhere in the JS parts where it relies on a column named id which doesn’t exist.

    #16298
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    > I bet there is a check somewhere in the JS parts where it relies on a column named id which doesn’t exist.
    Look’s like you are right, and I think I found an issue – Backbone checks for identifier field (“id” by default) to find out if model is new, and if it’s not – delete will not be triggered.

    That’s our issue, thank you very much for reporting – we need to fix it ASAP. For now you should specify identifier alias called “id” and pass it as a property.

    #16302

    cardiac
    Participant

    Thanks Yevhen

    I renamed the “caId” to “id” as the alias, and it’s working.

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

You must be logged in to reply to this topic.