Post by Terafyde » Sat Jun 01, 2024 2:56 pm

Using the inbuilt basic captcha (yes I know it not great) I have a weird problem that the image of the captcha is not shown on the contact us page, while the text and input box are shown. On all other pages like registration etc it is shown without problem. It is even shown on the contact page as a result of the error message from incorrect submit. Its just not shown when the contact page is first loaded. From what I can figure out from the firefox developer tools I think the image may not exist or is size 0x0.
Tested on oc 3.0.3.8 and 3.0.3.9 with default & custom themes
I have exhausted my limited skills....

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by ADD Creative » Sat Jun 01, 2024 3:41 pm

Have you tried clearing your browser cache? What is the response/status code of /index.php?route=extension/captcha/basic/captcha in the Network tab of your web browser's developer tool?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Terafyde » Sat Jun 01, 2024 3:51 pm

looking at ....index.php?route=extension/captcha/basic/captcha after the contact page loads without displaying the captcha image, it is ;
src="http://..../index.php?route=extension/captcha/basic/captcha" alt="The image “http://..../index.php?route=extension/captcha/basic/captcha” cannot be displayed because it contains errors."

I've managed to download the index.jpg from this and it is without any captcha code, ie the captcha graphics background without any Letters or numbers

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by IP_CAM » Sat Jun 01, 2024 11:32 pm

Do you have a valid reason to hide your Site URL, so someone else could take a look ?

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Terafyde » Sun Jun 02, 2024 8:31 am

If anyone wants to look
Contacts has no captcha image , until after submit has been pressed and captcha fails and generates a new code
http://www.digiplex.com.au/shop/index.p ... on/contact

Account registration and every other place captcha is used, no problem, the image is displayed
https://www.digiplex.com.au/shop/index. ... t/register

It seems that there is no captcha code generated by the contact page as the cause of the problem

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by IP_CAM » Sun Jun 02, 2024 6:33 pm

Seem to work well:
Image

Attachments

test.png

test.png (197.77 KiB) Viewed 1641 times


My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Sun Jun 02, 2024 6:52 pm

Works fine when using FireFox, not so with Chrome.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ADD Creative » Sun Jun 02, 2024 7:11 pm

Seems OK to me. However, your config.php files could be wrong. If your want to use https on your site you need to make all URLs https. The captcha image is being cached, which is not ideal.

Check your OpenCart error log, your PHP error log and your server error log. Maybe it was a one off error being cached or blocked by a firewall such as ModSecurity.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Terafyde » Sun Jun 02, 2024 7:26 pm

Thankyou for looking. But please follow through and submit a contact message.
This is because I'm experimenting and don't know what coding is currrent at that time. I have added some code during the captcha function when it creates the image to generate a new code - if (empty($this->session->data['captcha'])) { - but I don't know how to store this new code so it can be checked during validation. So even though the image is now displayed, data['captcha'] is probably still empty and validation will fail.
So at any given moment I could have different experimental coding running, so first looks could be deceiving. My potential fix is dodgy but its all my skill level allows. Fixing the actual cause why the contact page doesn't create a code is what really needs to be corrected.

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by Terafyde » Sun Jun 02, 2024 7:39 pm

Thanks for you comments and testing. It works for me on the same PC using Opera browser but not with firefox. And i suspect it worked previously with older versions of firefox.
I wont say its solved, but think its more to do with whats going on outside opencart than within it.

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by ADD Creative » Sun Jun 02, 2024 8:16 pm

Try this fix for cache control.
https://github.com/opencart/opencart/pull/13599

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Terafyde » Sun Jun 02, 2024 10:10 pm

I've done the cache control fix, and if I've done it right. The image does always display now on the contact page , except the code doesn't match and fails submit validation.

Newbie

Posts

Joined
Sun Aug 05, 2018 3:55 pm

Post by ADD Creative » Sun Jun 02, 2024 10:34 pm

You will need to clear your web browser cache after making that change.

You also need to fix your config.php and admin/config.php files.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Sun Jun 02, 2024 10:36 pm

Perhaps it's doing some wrong image caching somewhere. Is your server using a CDN?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Mon Jun 03, 2024 9:02 pm

Terafyde wrote:
Sat Jun 01, 2024 2:56 pm
Using the inbuilt basic captcha (yes I know it not great)
Just use this: https://www.opencart.com/index.php?rout ... er=antropy

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 19 guests