Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
5 votes

Node ID caching on hook_form_alter()

When you get route parameters you need this cache context: $form['#cache']['contexts'][] = 'route'; You might also want to add the node cache data so that the form gets invalidated when the node is ...
user avatar
  • 87.1k
3 votes

Node ID caching on hook_form_alter()

The problem is that the webform gets cached with the $node data from the first node visited, but you need the webform to be unique per node. You can unset the cache keys for your webform - this will ...
user avatar
  • 6,918
1 vote

How do I get the submitter of a webform submission?

OK. I think I can answer myself: $webform_submission->getOwnerId() is what I need.
user avatar
  • 11
1 vote
Accepted

Webform Conditional based on previous webform entry

Configure the select element containing "pre-test" and "post-test" options to have "Prepopulate" checked. Remember the machine name of the element, that will be the query ...
user avatar
  • 1,134
1 vote

How do I include composer.libraries.json in root composer.json without using the wikimedia/composer-merge-plugin plugin?

The alternate ways are documented. I think the one you would prefer is: Execute drush webform:composer:update, to update your Drupal installation's composer.json to include the Webform module's ...
user avatar
  • 2,645

Only top scored, non community-wiki answers of a minimum length are eligible