Recently, the modules/checkout/js/commerce_checkout.admin.js was refactored to use arrow functions. This change has broken the dragging functionality of checkout flows.

In fact, a console error is shown, just by visiting the admin/commerce/config/checkout-flows/manage page for a flow.

Consequently, the position of dragged items are not saved when clicking on the save button.

CommentFileSizeAuthor
#17 3414853-17.patch783 bytesjsacksick
#5 3414853-5.patch3.36 KBtbkot

Issue fork commerce-3414853

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

larjohn created an issue. See original summary.

larjohn’s picture

Issue summary: View changes

tBKoT made their first commit to this issue’s fork.

tbkot’s picture

StatusFileSize
new3.36 KB

Patch based on changes in MR

tbkot’s picture

Status: Active » Needs review
anybody’s picture

Priority: Normal » Major

Confirming this issue, just ran into it. No changes are being saved anymore.

anybody’s picture

Haven't looked deeper into the code, but the patch fixes the issue! Thank you @tBKoT! :)

proweb.ua’s picture

#5 works

  • jsacksick committed 58320c7b on 8.x-2.x authored by tBKoT
    Issue #3414853: Refactor JS to avoid 'this' in arrow functions.
    

  • jsacksick committed b456ab07 on 3.0.x authored by tBKoT
    Issue #3414853: Refactor JS to avoid 'this' in arrow functions.
    
jsacksick’s picture

Status: Needs review » Fixed

Committed, thank you for this!

anybody’s picture

@jsacksick I think I had issues yesterday with empty regions. The dragged elements landed somewhere else after saving. I guess this needs tests to compare the hidden select value set to the region name?

And for the quickfix I think it needs some more manual testing of such edge cases. Didn't have the time so far to do it, just wanted to let you know that there *might* still be issues with this.

Only tests can safe us ;)

jsacksick’s picture

I don't see any actual functionality change in the PR... Just "fixing" the existing code (unless I'm missing it), so it might be that the issue was present before?

anybody’s picture

@jsacksick that's possible. I'll try to reproduce it, just wanted to let you know. I dragged and dropped around a lot in the checkout flow yesterday and everything seemed to work fine except dragging into a region that was empty before. After saving, the item went into a differnet region, but I had no time to check it in detail and so I then made the changes using the "Show weights" functionality without Js through the selects.

Just wanted to let you know about the potential bug.

Without the fix from here, the whole d&d was broken as described.

jsacksick’s picture

Status: Fixed » Active

You're right... Reopening this as dragging to an empty region is broken....

jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new783 bytes

  • jsacksick committed 0aabebd6 on 8.x-2.x
    Issue #3414853 by tBKoT, jsacksick: Checkout flow items dragging broken...

  • jsacksick committed 078a4063 on 3.0.x
    Issue #3414853 by tBKoT, jsacksick: Checkout flow items dragging broken...

  • jsacksick committed 2e73f3b0 on 8.x-2.x
    Issue #3414853 by tBKoT, jsacksick: Checkout flow items dragging broken...

  • jsacksick committed 06257506 on 3.0.x
    Issue #3414853 by tBKoT, jsacksick: Checkout flow items dragging broken...
jsacksick’s picture

Status: Needs review » Fixed
anybody’s picture

Thank you very much @jsacksick! 🎉

hockey2112’s picture

Are both patches necessary to resolve this issue?

anybody’s picture

@hockey2112 no it's fixed in the latest dev release!

Perhaps we can have a new stable?

liliplanet’s picture

Yes please, new release as it affects order checkout flows considerably, thank you.

jsacksick’s picture

New release was tagged today!

liliplanet’s picture

Hi @jacksick, updated to latest version, still no joy, drag is not saving.

jsacksick’s picture

HI @Liliplanet, did you rebuild your caches? It works perfectly for me and the fix was confirmed by 2 other people at least in this issue?

liliplanet’s picture

Hi @jacksick, yes thank you. Yes I updated via composer (with all dependencies), rebuilt cache, still not saving.

liliplanet’s picture

Hi @jacksick, awesome news. I just upgrade D10 and it fixed, drag and drop saves beautifully, thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.