Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2018 at 21:06 UTC
Updated:
16 Jun 2022 at 17:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jrockowitz commentedYes, this is possible. The pattern would be to add a submission limit field called to field_webform_limit_total to your event node and then have its value applied to the webform using the settings handlers.
I did find a bug when passing a token value to an integer setting which is being addressed via the attached patch.
Comment #3
jrockowitz commentedComment #5
jrockowitz commentedThe attached patch adds the above pattern to the 'Webform Demo: Event Registration System' module.
Comment #8
jrockowitz commentedComment #10
jrockowitz commentedI committed the patch and wrote a change record. Please download the latest dev release to review.
Comment #11
kriboogh commentedI tried your solution with the latest dev, but I always get the error the token is invalid.
I added a field with system name field_event_signup_limit and added a settings handler on the webform with:
limit_total: '[webform_submission:node:field_event_signup_limit]'
or
limit_total: '[webform_submission:source-entity:field_event_signup_limit]'
but both give met an invalid token error when trying to save the settings.
Comment #12
jrockowitz commentedAre you able to edit the Demo:Event webform handler without any token errors?
You might need to update the latest release of the token module.
Comment #13
kriboogh commentedI didn't have the webform_node module enabled. My bad.
Comment #15
yaach commentedI have a similar issue, I am trying to recreate the Event Registration demo. I followed the steps above to create a submission limit on my Event node. Then I added that to the webform handler as explained in #2. The configuration does not work because my limit was 2 but I am still able to submit to the form, in other words, the limit does not work.
Comment #16
yaach commentedSee this https://www.drupal.org/project/webform/issues/3056092#comment-14574204 to see what I found.