I spent a few hours on this issue. I added submit callback in Drupal\dc_ajax_...

Contribution Date
Technology
Contribution Project
Contribution Details

I spent a few hours on this issue. I added submit callback in Drupal\dc_ajax_add_cart_views\Plugin\views\field\RemoveButton, this was removing the order item, and was returning an ajax response that would refresh the cart block. I used dc_ajax_add_cart.refresh_page_elements_helper service. But it throws an exception:

LogicException: A stray renderRoot() invocation is causing bubbling of attached assets to break.

Looks like the views submit callback is not the right place to return the ajax response. (unlike form submit callback)

I also tried doing the above using a custom ajax callback, but it breaks the ajax functionality of the order item removal.

I need help on this issue. It would be great if someone proposes an approach to achieve this, or may be point out what I am doing wrong.

Contribution Author
Files count
0
Patches count
0