Closed (fixed)
Project:
CAPTCHA
Version:
8.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2017 at 09:45 UTC
Updated:
28 Mar 2019 at 08:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
hswong3i commentedRefer to class MachineName, the limitation of max 64 characters due to its default
#maxlength:Patch update
#maxlengthof bothlabelandformIdinto 255, so should solve this issue correctly.Comment #4
saravanaprasanth commentedComment #5
saravanaprasanth commentedHi ,
I have applied the patch #3(Patch applied cleanly). After applying the patch I can able to create the large Form id. Also, I can able to edit/change the form id of the existing form to the large form id but the issue still appearing needs to be reworked.(Captcha not working).
For the larger form id, the captcha was not appearing/working.
Attached screenshots of the same.
Comment #6
saravanaprasanth commentedComment #7
saravanaprasanth commentedComment #8
saravanaprasanth commentedHi ,
I have applied the patch #3(Patch applied cleanly). After applying the patch I can able to create the large Form id. Also, I can able to edit/change the form id of the existing form to the large form id but the issue still appearing needs to be reworked.(Captcha not working).
For the larger form id, the captcha was not appearing/working.
Attached screenshots of the same.
Comment #9
couturier commentedWe'd love to get this patch working and applied but also need more help with the 8.x port in general.
Comment #10
bnjmnmThe attached patch fixed the issue for me. Instead of changing the char limits on the form, I changed the condition in captcha_form_alter to find the Captcha Point entity based on form id instead of entity id, as the two aren't guaranteed to match.
Comment #11
elachlan commentedComment #12
elachlan commentedComment #14
bnjmnmUpdated patch based on test results
Comment #15
elachlan commentedComment #17
bnjmnmHad to rewrite the patch to accommodate captcha points provided by the module on install, which have their label property set to null.
Ideally, I'd prefer to have the default config entities have label: match the formId: value instead of being null so two queries aren't necessary in form_alter, but this wouldn't work for users with the module already installed.
Comment #18
bnjmnmReroll
Comment #19
elachlan commentedCould we write a test for this? So we don't end up breaking it later?
Comment #20
bnjmnmAdded test
Comment #21
bnjmnmUpdate to include testing module
Comment #22
bnjmnmComment #24
elachlan commentedComment #26
joe huggansThis patch has failed for me when updating core to 8.6.13, are we safe to just use - captcha 8.x-1.x-dev ?
Edit: tested dev and isn't working, can't seem to get anything to work for me
patching file captcha.module
Hunk #1 FAILED at 164.
Hunk #2 FAILED at 183.
Hunk #3 succeeded at 152 with fuzz 2 (offset -40 lines).
2 out of 3 hunks FAILED -- saving rejects to file captcha.module.rej
patching file modules/captcha_long_form_id_test/captcha_long_form_id_test.info.yml
patching file modules/captcha_long_form_id_test/captcha_long_form_id_test.routing.yml
patching file modules/captcha_long_form_id_test/src/Form/LongIdForm.php
patching file src/Tests/CaptchaTestCase.php
Hunk #1 succeeded at 18 (offset -1 lines).
Hunk #2 succeeded at 259 (offset -12 lines).
patch '-p0' --no-backup-if-mismatch -d 'web/modules/contrib/captcha' < '/tmp/5c94dd0276796.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/captcha.module b/captcha.module
|index 9d787d0..ff61e56 100755
|--- a/captcha.module
|+++ b/captcha.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
patching file b/modules/captcha_long_form_id_test/captcha_long_form_id_test.info.yml
patching file b/modules/captcha_long_form_id_test/captcha_long_form_id_test.routing.yml
patching file b/modules/captcha_long_form_id_test/src/Form/LongIdForm.php
can't find file to patch at input line 141
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Tests/CaptchaTestCase.php b/src/Tests/CaptchaTestCase.php
|index c386d4c..8fa95e5 100755
|--- a/src/Tests/CaptchaTestCase.php
|+++ b/src/Tests/CaptchaTestCase.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
patch '-p2' --no-backup-if-mismatch -d 'web/modules/contrib/captcha' < '/tmp/5c94dd0276796.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/captcha.module b/captcha.module
|index 9d787d0..ff61e56 100755
|--- a/captcha.module
|+++ b/captcha.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
patching file captcha_long_form_id_test/captcha_long_form_id_test.info.yml
patching file captcha_long_form_id_test/captcha_long_form_id_test.routing.yml
patching file captcha_long_form_id_test/src/Form/LongIdForm.php
can't find file to patch at input line 141
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Tests/CaptchaTestCase.php b/src/Tests/CaptchaTestCase.php
|index c386d4c..8fa95e5 100755
|--- a/src/Tests/CaptchaTestCase.php
|+++ b/src/Tests/CaptchaTestCase.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
patch '-p4' --no-backup-if-mismatch -d 'web/modules/contrib/captcha' < '/tmp/5c94dd0276796.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/captcha.module b/captcha.module
|index 9d787d0..ff61e56 100755
|--- a/captcha.module
|+++ b/captcha.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
can't find file to patch at input line 61
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/modules/captcha_long_form_id_test/captcha_long_form_id_test.info.yml b/modules/captcha_long_form_id_test/captcha_long_form_id_test.info.yml
|new file mode 100644
|index 0000000..93b2b61
|--- /dev/null
|+++ b/modules/captcha_long_form_id_test/captcha_long_form_id_test.info.yml
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 73
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/modules/captcha_long_form_id_test/captcha_long_form_id_test.routing.yml b/modules/captcha_long_form_id_test/captcha_long_form_id_test.routing.yml
|new file mode 100644
|index 0000000..0fc46ae
|--- /dev/null
|+++ b/modules/captcha_long_form_id_test/captcha_long_form_id_test.routing.yml
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file Form/LongIdForm.php
can't find file to patch at input line 141
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Tests/CaptchaTestCase.php b/src/Tests/CaptchaTestCase.php
|index c386d4c..8fa95e5 100755
|--- a/src/Tests/CaptchaTestCase.php
|+++ b/src/Tests/CaptchaTestCase.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
Comment #27
joe huggans#3 worked for me after trying other patches. 8.x-1.0-beta1