Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On a webform configuration page, eg. node/443/webform/configure, the 'Next submission number' under the 'Advanced Settings' fieldset doesn't update between node submissions if Entity Cache is enabled.
This means that the form complains upon resubmission that The next submission number must be at least [#number] (greater than any existing serial number).
This problem only occurs when Entity Cache is enabled. Clearing the cache before loading the configuration page will cause the 'Next submission number' to display correctly.
Comment | File | Size | Author |
---|---|---|---|
#11 | webform-next_serial-2333139-11.patch | 5.8 KB | DanChadwick |
#8 | next-submission-number-non-cached-2333139-8.patch | 692 bytes | aaron.ferris |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedIt's going to be up to someone that uses Entity Cache to provide a patch this.
Comment #2
petednz CreditAttribution: petednz commentedjust taking out typo in title - fyi on the OP we disabled entity cache
Comment #3
petednz CreditAttribution: petednz commentedAnd flagging that I just edited a(nother?) webform on same system and again got the warning that the submission ID needed to be higher - so not clear if the issue is that turning entity cache off is a sufficient solution for us, or if it is once we resave all webform settings, or something else.
Comment #4
DanChadwick CreditAttribution: DanChadwick commentedI suspect this has been fixed. The code now uses the higher of the serial number in the webform node or the highest serial number used + 1.
#2349081: Drush sql-sync and PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'xxx' for key 'nid_serial': INSERT INTO {webform_submissions}
Please re-open if this is not fixed in the latest dev and hopefully a patch. ;)
Comment #5
aaron.ferris CreditAttribution: aaron.ferris commentedI've just come across this issue using 7.x-4.8 and entity cache. I believe the issue is the default value for the 'Next submission number' is using a cached value from the node object. I'm working on a patch that i'll add once it's done, pretty sure it fixes the issue seen here (at least it seems to for me).
I hope i'm OK in reopening this....
Comment #6
aaron.ferris CreditAttribution: aaron.ferris commentedComment #7
aaron.ferris CreditAttribution: aaron.ferris commentedComment #8
aaron.ferris CreditAttribution: aaron.ferris commentedComment #9
aaron.ferris CreditAttribution: aaron.ferris commentedComment #11
DanChadwick CreditAttribution: DanChadwick commentedThere's a problem with #8. If you set the serial number to be much higher -- e.g. 100000, then edit the webform again, you'll lose that setting. It would be reset to the next highest number.
This patch:
I have tested this with and without entitycache. I am not using memcache, so additional testing would be helpful.
Committed to 7.x-4.x and 8.x.
Comment #13
aaron.ferris CreditAttribution: aaron.ferris commentedThanks Dan. Looks good with respect to the issue we were seeing.