Closed (fixed)
Project:
Webform
Version:
8.x-5.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2019 at 00:17 UTC
Updated:
11 May 2019 at 13:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jrockowitz commentedI think we are going to run into caching issues with a token like this one but I am open to trying to set it up.
Comment #3
jrockowitz commentedThe calculation is probably
{last completed} - {interval} = {remaining}The token syntax could be something like
[webform-submission:interval:user:wait].Comment #4
c.e.a commentedThe best bet here is to display an informational message for the user for two reasons and let them take care about the caching issue:
[webform-submission:interval:user:wait]to display the remaining time for the next submission.It will be usefull if you can divide the tokens into something like:
Another solution but it is more complicated:
Add the interval time to a countdown timer element to be updated using Ajax.
Comment #6
jrockowitz commentedPlease review the attached patch.
For now, I think just displaying the wait time and second should be okay. Drupal's date diff format does not support returning only minutes.
Comment #8
jrockowitz commentedThis patch adds a max cache age to the bubbleable metadata.
Comment #9
c.e.a commentedPatch #8 returned:
Comment #10
jrockowitz commentedPlease apply the patch to the latest dev release or check out the
3049534-limit-waitbranch.Comment #12
jrockowitz commentedThe attached patch has minor spacing tweaks and should apply to the latest dev release without any problems.
Comment #14
jrockowitz commentedThe attached patch includes test coverage.
Comment #15
c.e.a commentedI am very very sorry about the delay, I totally forget about this feature request... now I am back again!
I have tested #14 and it is working as expected.
However, when the webform is closed from further submission until the countdown reaches the end, an informational message will appear to the user:
This webform is closed. Only submission administrators are allowed to access this webform and create new submissions.Only if you can remove this informational message, because it will confuse the users...
Thank you,
Comment #16
jrockowitz commentedCan you please post an example webform?
Comment #17
c.e.a commentedOk... I am sorry, my bad!
the informational message is shown only for admin users and not for other roles.
So everything is working as expected!
Thank you,
Comment #18
jrockowitz commentedComment #19
c.e.a commentedComment #20
c.e.a commentedChanging the status at the same time!
Comment #22
jrockowitz commented