Add altcha to the list of excludedItems
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
The fix is a one-line addition to the excludedItems array in src/web/assets/frontend/src/js/formie-form-theme.js, placed before 'submitAction' alongside the other captcha response names. Read how that array is used to skip fields when Formie decides a form has changed, then add 'altcha'. Done when the altcha hidden field no longer triggers the unload warning on a form with enableUnloadWarning set.
Written by the indexing model from the issue text.
Description
What are you trying to do?
Hi,
I am using Formie and Altcha, an open-source captcha solution based on real cpu proof-of-work, which is integrated into Formie thanks to the jalendport/craft-altcha plugin.
However, Formie does not natively features altcha in its excludedItems array, which cause the following problem:
- Our forms have the
enableUnloadWarningset totrue; - We have tiny forms on our footers, such as newsletter subscription ;
- End users access our website -> page and Formie load ;
- Altcha solves the challenge in the background (after DOM load) and updates the hidden
altchafield ; altchafield is not actively excluded by Formie, thus the form is flagged as updated ;- When changing pages, reloading or leaving site, browser shows a popup such as "Are you sure? Changes you made may not be saved."
What's your proposed solution?
Many other captchas solutions are already featured in src/web/assets/frontend/src/js/formie-form-theme.js:
const excludedItems = [
'g-recaptcha-response',
'h-captcha-response',
'CRAFT_CSRF_TOKEN',
'CSRF_TOKEN',
'__JSCHK',
'__DUP',
'beesknees',
'cf-turnstile-response',
'frc-captcha-solution',
'frc-captcha-response',
'snaptcha',
// <--- add 'altcha' here
'submitAction',
];
Thank you !
Additional context
No response
- Dominant language
- PHP
- Stars
- 102
- Forks
- 96
- Avg merge
- 1h 8m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from verbb/formie
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
verbb/formie#2987 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 48/100
verbb/formie#3000 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
verbb/formie#2998 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 4 days
-
Перевод устарел
Difficulty 2/5 Half a day Newbie friendliness 62/100
-
home php
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vincent-peugnet/wcms#670 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
freescout-help-desk/freescout#5731 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Automattic/blocks-engine#2803 ·
Maintainers usually reply within 1 day