Commit 159032da authored by Liam Morland's avatar Liam Morland
Browse files

Merge branch 'feature/ISTWCMS-4881-idoroshe-no_auto_captcha_when_migrating' into '1.0.x'

ISTWCMS-4881: don't automatically add a CAPTCHA when migrating

See merge request !47
parents cd1b38e5 ed4881f7
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
* Workbench module file. * Workbench module file.
*/ */
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\webform\WebformInterface;
/** /**
* Implements hook_form_BASE_FORM_ID_alter(). * Implements hook_form_BASE_FORM_ID_alter().
...@@ -131,9 +131,9 @@ function uw_sites_all_update_projects_alter(&$projects) { ...@@ -131,9 +131,9 @@ function uw_sites_all_update_projects_alter(&$projects) {
/** /**
* Implements hook_ENTITY_TYPE_presave(). * Implements hook_ENTITY_TYPE_presave().
*/ */
function uw_sites_all_webform_presave(EntityInterface $webform): void { function uw_sites_all_webform_presave(WebformInterface $webform): void {
// Add a Webform CAPTCHA component to each newly-created Webform. // Add a Webform CAPTCHA component to each newly-created Webform.
if ($webform->isNew()) { if ($webform->isNew() && empty($webform->getElementsRaw())) {
$elements = [ $elements = [
'captcha' => [ 'captcha' => [
'#type' => 'captcha', '#type' => 'captcha',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment