Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: refactor captcha implementation #9595

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Conversation

Ruud68
Copy link
Contributor

@Ruud68 Ruud68 commented Dec 11, 2023

Pull Request for Issue # .

Summary of Changes

refactored the captcha implementation: it is now controlled via:

  • the new event triggering system
  • global site config configured captcha (instead of calling all captchaś and take first response)

Also did some changes on the display (position) of the captcha in various places where the captcha is displayed

Also removed the name="submit" from the form's submit input field > this is a technical reason: every form has a submit function with which you can programmatically (via JS) submit the form, e.g. form.submit() bit when the form has an element with a name of "submit" then this element masks that function and as such that function cannot be called again leading to potential strange behavior.

Testing Instructions

test topc / message creation / responndign with different capctha's and see if it still works correct.

@rich20
Copy link
Member

rich20 commented Dec 11, 2023

I get this error:
Class "ScssPhp\ScssPhp\Compiler" not found

() JROOT/libraries/kunena/src/Template/KunenaTemplate.php:1655
2 Kunena\Forum\Libraries\Template\KunenaTemplate->compileScss() JROOT/libraries/kunena/src/Template/KunenaTemplate.php:878
3 Kunena\Forum\Libraries\Template\KunenaTemplate->createCacheDir() JROOT/components/com_kunena/template/aurelia/template.php:130
4 KunenaTemplateAurelia->initialize() JROOT/libraries/kunena/src/Controller/Application/Display.php:244
5 Kunena\Forum\Libraries\Controller\Application\Display->before() JROOT/libraries/kunena/src/Controller/Application/Display.php:102
6 Kunena\Forum\Libraries\Controller\Application\Display->execute() JROOT/components/com_kunena/src/Dispatcher/Dispatcher.php:100
7 Kunena\Forum\Site\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
8 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:218
9 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:261
10 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:306
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:58
12 require_once() JROOT/index.php:32

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 12, 2023

can you build a 6.3 version without my PR in it? I don't think this is related to my PR but that 6.3 itself is not fully working correct?

@xillibit I think 6.3 is not based on the K6.2.2 yet. in 6.2 the namespace for the compiler is: KunenaScssPhp\ScssPhp\Compiler;

where in 6.3 this name space is ScssPhp\ScssPhp\Compiler

@xillibit
Copy link
Member

Because i haven't merged the changes from K6.2 since i have created the K6.3 after the 20 october. So i need to merge your branch before that else there will be conflicts

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 12, 2023

Okay, so we have to wait then with testing. On my test environment it is not an issue as I do not have any css things that need to be compiled, so the error is not there for me.

@xillibit
Copy link
Member

@rich20 : you can re-test now i have just merged the change from K6.2 tp avoid the error that you have

@rich20
Copy link
Member

rich20 commented Dec 14, 2023

I tested it with:
CAPTCHA - Invisible reCAPTCHA
plg_captcha_recaptcha
Captcha - reCAPTCHA v3
(tested without key)
It seems to work, but I can only recognise it by the following changes.

If CAPTCHA - Invisible reCAPTCHA is selected - Captcha symbol is displayed
If plg_captcha_recaptcha is selected - Recaptcha Error no public key
If Captcha - reCAPTCHA v3 is selected - nothing is displayed

It can therefore be assumed that the selection works.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 14, 2023

hi @rich20 thanks for testing! when selecting recaptcha v3 as your captcha plugin, you can see if it is at least loading the recapctha JS files in your browser tab.

If you want I can also mail you my own captcha plugin to test with (let me know if you want this) and where to send it to), but I feel confident that if the plugins you have used are working then it works correct and should work for all Joomla captcha plugins.

@rich20
Copy link
Member

rich20 commented Dec 14, 2023

On this browser tab there is neither a script nor an error message regarding this captcha. I can only notice that this one captcha is not displayed. It works with the other two.
I can also test it with your captcha if you send it to me at rich@*kunena.org please.

@rich20
Copy link
Member

rich20 commented Dec 14, 2023

@Ruud68 Can you please check this? Your captcha is not displayed anywhere, also not in the Joomla registration form.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 15, 2023

Good morning, offline today so quick reply via mobile.
Plugin is enabled?
Plugin is configured to 'display' (first tab)
Plugin is selected in site global config?
Have it working myself on multiple sites myself, no issues.
If it still doesn't work, I can look into it tomorrow at the earliest

@rich20
Copy link
Member

rich20 commented Dec 15, 2023

Sorry, I was completely off track. All works as it should and can be merged.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 16, 2023

Thanks for reporting back @rich20 , must admit that you scared me a little, days before the release of this plugin :)
BTW, when you enable debug on the captcha plugin you can see in the plugin log file if it is actually working / responding to the captcha etc.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 16, 2023

Add fix for #9597

@rich20
Copy link
Member

rich20 commented Dec 16, 2023

  • Success - the "Deprecated" error is gone now

@xillibit xillibit merged commit f393762 into Kunena:K6.3 Dec 18, 2023
4 checks passed
@Ruud68 Ruud68 deleted the captcha-refactor branch December 19, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants