Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-gao committed Sep 12, 2024
1 parent b916ff4 commit 09ac357
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tide_webform.module
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ function _tide_webform_captcha_form_validate(&$form, FormStateInterface $form_st
$settings['captcha_details'] = [
'site_key' => $term->get('field_site_key')->value,
'term_id' => (int)$term_id,
'captcha_id' => _tide_webform_get_captcha_id($term),
];
} else {
$settings['captcha_details'] = null;
Expand Down Expand Up @@ -611,3 +612,11 @@ function _tide_webform_threshold_validate($element, FormStateInterface $form_sta
$form_state->setError($element, t('Enter a value between 0.0 and 1.0. Use only one decimal place (e.g., 0.0, 0.5, 1.0).'));
}
}

/**
* Gets captcha id.
*/
function _tide_webform_get_captcha_id(Term $term) {
$uri = $term->toLink()->getUrl()->toString();
return pathinfo(rtrim($uri, '/'), PATHINFO_BASENAME);
}

0 comments on commit 09ac357

Please sign in to comment.