Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
captcha
Commits
61fe1eae
Commit
61fe1eae
authored
Sep 09, 2022
by
Suhyeon Hong
Committed by
Jakob Perry
Sep 09, 2022
Browse files
Issue #3293710 by suhyeon: CAPTCHA point form ID is set to null
parent
315cfaab
Changes
6
Hide whitespace changes
Inline
Side-by-side
captcha.install
View file @
61fe1eae
...
...
@@ -112,15 +112,18 @@ function captcha_install() {
if
(
!
\
Drupal
::
service
(
'config.installer'
)
->
isSyncing
()
&&
\
Drupal
::
moduleHandler
()
->
moduleExists
(
'node'
))
{
$form_ids
=
[];
$label
=
[];
// Add form_ids of all currently known node types too.
foreach
(
node_type_get_names
()
as
$type
=>
$name
)
{
$form_ids
[]
=
'node_'
.
$type
.
'_form'
;
$label
[]
=
'node_'
.
$type
.
'_form'
;
}
$captcha_storage
=
\
Drupal
::
entityTypeManager
()
->
getStorage
(
'captcha_point'
);
foreach
(
$form_ids
as
$form_id
)
{
foreach
(
$form_ids
as
$index
=>
$form_id
)
{
$values
=
[
'label'
=>
$label
[
$index
],
'formId'
=>
$form_id
,
'captchaType'
=>
'default'
,
'status'
=>
FALSE
,
...
...
@@ -143,3 +146,23 @@ function captcha_update_8901(&$sandbox) {
->
installEntityType
(
$entityType
);
}
}
/**
* Implements hook_update_N().
*/
function
captcha_update_8902
(
&
$sandbox
)
{
$query
=
\
Drupal
::
entityQuery
(
'captcha_point'
);
$query
->
notExists
(
'label'
);
$entity_ids
=
$query
->
execute
();
if
(
!
empty
(
$entity_ids
)
&&
is_array
(
$entity_ids
))
{
foreach
(
$entity_ids
as
$entity_id
)
{
$captcha_point_id
=
$entity_id
;
$captcha_point
=
\
Drupal
::
entityTypeManager
()
->
getStorage
(
'captcha_point'
)
->
load
(
$captcha_point_id
);
$captcha_point
->
set
(
'label'
,
$captcha_point
->
getFormId
());
$captcha_point
->
save
();
}
}
}
config/install/captcha.captcha_point.contact_message_feedback_form.yml
View file @
61fe1eae
...
...
@@ -3,4 +3,4 @@ status: false
dependencies
:
{
}
formId
:
contact_message_feedback_form
captchaType
:
default
label
:
null
label
:
contact_message_feedback_form
config/install/captcha.captcha_point.contact_message_personal_form.yml
View file @
61fe1eae
...
...
@@ -3,4 +3,4 @@ status: false
dependencies
:
{
}
formId
:
contact_message_personal_form
captchaType
:
default
label
:
null
label
:
contact_message_personal_form
config/install/captcha.captcha_point.user_login_form.yml
View file @
61fe1eae
...
...
@@ -3,4 +3,4 @@ status: false
dependencies
:
{
}
formId
:
user_login_form
captchaType
:
default
label
:
null
label
:
user_login_form
config/install/captcha.captcha_point.user_pass.yml
View file @
61fe1eae
...
...
@@ -3,4 +3,4 @@ status: false
dependencies
:
{
}
formId
:
user_pass
captchaType
:
default
label
:
null
label
:
user_pass
config/install/captcha.captcha_point.user_register_form.yml
View file @
61fe1eae
...
...
@@ -3,4 +3,4 @@ status: false
dependencies
:
{
}
formId
:
user_register_form
captchaType
:
default
label
:
null
label
:
user_register_form
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment