Closed (fixed)
Project:
State Machine
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Mar 2017 at 19:34 UTC
Updated:
27 Nov 2018 at 15:34 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
nikathoneAnd here is the patch. Took the same approach as in https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/cart/src... but this will need anybody implementing a
hook_form_FORM_ID_alter()to update their code if accepted.Comment #3
smazI had this issue on a view, and the patch provided fixes the issue - many thanks.
I've marked needs work, for the following (a nitpick really):
Can we not shorten that to just:
If not for whatever reason, then feel free to mark this as RTBC!
Comment #4
josephdpurcell commentedI ran into this issue as well. The patch from #2 works.
Putting the increment in the constructor should be avoided, but I am not aware of a better pattern for addressing this type of issue.
I'm uploading a patch that implements the suggestion in #3, and setting to RTBC.
Comment #5
josephdpurcell commentedUpdated description with an example of how this problem might arise.
Comment #6
jcandan commented#4 is working great!
Comment #7
uniquename commentedworks fine for me!
Comment #8
bojanz commentedWe did the static counter approach in Commerce, and ended up with a bunch of bugs, where the static wasn't updated properly on #ajax.
We had to replace it with a more stable solution. So, let's use the entity type and ID here instead of the static counter.
Comment #10
bojanz commentedRewrote the patch and committed. Thanks, everyone!
Comment #11
sittard commentedWe are currently using State Machine 8.x-1.0-beta3 and we need this patch. Are we OK to migrate to the dev branch or should we wait for a beta 4 release? Thanks.
Comment #12
bojanz commentedReleased RC1, you can update to that.
Comment #13
sittard commentedSuper - Thanks ;)