meteo-concept / hcaptcha-bundle Goto Github PK
View Code? Open in Web Editor NEWA Symfony 4+ bundle to bring hCaptcha into your forms
License: Other
A Symfony 4+ bundle to bring hCaptcha into your forms
License: Other
Hello,
I am using this bundle to have a captcha in my contact form, and sometimes I receive a server error :
{
"class": "TypeError",
"message": "Argument 1 passed to MeteoConcept\\HCaptchaBundle\\Form\\HCaptchaResponse::__construct() must be of the type string, null given, called in /home/kreyolgyhm/www/vendor/meteo-concept/hcaptcha-bundle/Form/DataTransformer/HCaptchaValueFetcher.php on line 58",
"code": 0,
"file": "/home/kreyolgyhm/www/vendor/meteo-concept/hcaptcha-bundle/Form/HCaptchaResponse.php:33",
"trace": [
"/home/kreyolgyhm/www/vendor/meteo-concept/hcaptcha-bundle/Form/DataTransformer/HCaptchaValueFetcher.php:58",
"/home/kreyolgyhm/www/vendor/symfony/form/Form.php:1085",
"/home/kreyolgyhm/www/vendor/symfony/form/Form.php:646",
"/home/kreyolgyhm/www/vendor/symfony/form/Form.php:576",
"/home/kreyolgyhm/www/vendor/symfony/form/Extension/HttpFoundation/HttpFoundationRequestHandler.php:109",
"/home/kreyolgyhm/www/vendor/symfony/form/Form.php:490",
"/home/kreyolgyhm/www/src/Controller/HelpController.php:27",
"/home/kreyolgyhm/www/vendor/symfony/http-kernel/HttpKernel.php:157",
"/home/kreyolgyhm/www/vendor/symfony/http-kernel/HttpKernel.php:79",
"/home/kreyolgyhm/www/vendor/symfony/http-kernel/Kernel.php:196",
"/home/kreyolgyhm/www/public/index.php:28"
]
}
It looks like it is caused by the captcha result being absent from the request. I don't know how it happens with my clients but when I delete the captcha widget from the webpage, I receive this error too. Is there anything to do to fix it?
I am using latest Symfony 6.x with Flex.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires meteo-concept/hcaptcha-bundle ^3.3 -> satisfiable by meteo-concept/hcaptcha-bundle[v3.3.0].
- meteo-concept/hcaptcha-bundle v3.3.0 requires psr/http-factory-implementation ^1.0 -> could not be found in any version, but the following packages provide it:
- guzzlehttp/psr7 PSR-7 message implementation that also provides common utility methods
- nyholm/psr7 A fast PHP7 implementation of PSR-7
- http-interop/http-factory-guzzle An HTTP Factory using Guzzle PSR7
- laminas/laminas-diactoros PSR HTTP Message implementations
- zendframework/zend-diactoros PSR HTTP Message implementations
- slim/psr7 Strict PSR-7 implementation
- typo3/cms-core TYPO3 CMS Core
- tuupola/http-factory Lightweight autodiscovering PSR-17 HTTP factories
- httpsoft/http-message Strict and fast implementation of PSR-7 and PSR-17
- typo3/cms TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj an
- php-extended/php-http-message-factory-psr17 An implementation of the psr-17 based on the php-http-message-psr7 library
- windwalker/uri Windwalker Uri package
- mileschou/psr The support library for PSR
- oro/platform Business Application Platform (BAP)
- windwalker/http Windwalker Http package
- sunrise/http-factory HTTP factory for PHP 7.1+ based on PSR-17
- http-interop/http-factory-slim An HTTP Factory using Slim HTTP
- bittyphp/http PSR-7 and PSR-17 HTTP implementation.
- windwalker/framework The next generation PHP framework.
- yiisoft/psr-dummy-provider PSR Dummy Provider
... and 45 more.
Consider requiring one of these to satisfy the psr/http-factory-implementation requirement.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require meteo-concept/hcaptcha-bundle:*" to figure out if any version is installable, or "composer require meteo-concept/hcaptcha-bundle:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Do you have any idea why is this happening?
It seems that the bundle can't be installed with symfony/http-client
of version >=5.2
.
$ composer require meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7
Using version ^0.1.0@alpha for meteo-concept/hcaptcha-bundle
Using version ^1.4 for nyholm/psr7
./composer.json has been updated
Running composer update meteo-concept/hcaptcha-bundle symfony/http-client nyholm/psr7
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires meteo-concept/hcaptcha-bundle ^0.1.0@alpha -> satisfiable by meteo-concept/hcaptcha-bundle[v0.1.0-alpha].
- meteo-concept/hcaptcha-bundle v0.1.0-alpha requires symfony/http-client >=4.3 <5.2 -> found symfony/http-client[v4.3.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.1.x-dev] but it conflicts with your root composer.json require
(5.2.*).
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
The newest version of HCaptchaBundle (v3.4.0) passes NULL values to urlencode() in \MeteoConcept\HCaptchaBundle\Service\HCaptchaVerifier::verify. Passing NULL values to urlencode() is deprecated and results in an unhandled ErrorException warning.
...and it looks like psr/http-factory-implementation
is an unknown package.
php-fig/http-factory
is as close as it gets.
in https://github.com/Meteo-Concept/hcaptcha-bundle#configuration
you write HCAPTACHA_SECRET instead of HCAPTCHA_SECRET
otherwise everything is perfect, your bundle is easy and quick to use. he his perfect !
Hello,
Is there a symfony 6.x support planned?
Right now composer.json version constraints prevent installation but looks like code is compatible (I can provide help for tests if needed :) )
Hi!
I got an error in my try to install the package to Symfony 3.2:
PHP message: PHP Fatal error: Uncaught InvalidArgumentException: [ERROR 1871] Element '{http://symfony.com/schema/dic/services}defaults': This element is not expected. Expected is ( {http://symfony.com/schema/dic/services}service ). (in /var/www/website/web/ - line 8, column 0) in /var/www/website/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:96
Stack trace:
#0 /var/www/website/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(263): Symfony\Component\Config\Util\XmlUtils::loadFile('/var/www/websit...', Array)
#1 /var/www/website/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(41): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM('/var/www/websit...')
#2 /var/www/website/vendor/meteo-concept/hcaptcha-bundle/DependencyInjection/MeteoConceptHCaptchaExtension.php(18): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load('services.xml')
#3 /var/www/website/vendor/symf" while reading response header from upstream, client: 172.19.0.1, server: website, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "127.0.0.1:8080"
Could you please help me to figure it out? Thank you in advance!
Hello, I am on symfony 3.4, with php 7.4.
I followed the install guide but when I valided the form with hCaptcha confirmed, I have this error and I don't know how to do to debug this.
Any idea?
request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Cannot instantiate interface Psr\Http\Client\ClientInterface" at /home/www/site/var/cache/prod/ContainerQuncj5h/getMeteoConceptHCaptcha_CaptchaVerifierService.php line 8 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Cannot instantiate interface Psr\\Http\\Client\\ClientInterface at /home/www/site/var/cache/prod/ContainerQuncj5h/getMeteoConceptHCaptcha_CaptchaVerifierService.php:8)"} []
Let me know if you need more informations! :)
Works perfectly, use it for my signup form. But I can't use it in my login form, as it uses a custom Symfony authenticator. There aren't any docs outside of the readme, which doesn't help.
If there isn't any support, is it possible to check and verify the captcha myself?
Thank you!
Sorry if this is not the place, but I've updated my website to PHP 8 and got everything over to Symfony 5.2 including all packages, except for this one. For now I've resorted to reCaptcha, but I really don't want to use Google junk, and it's working poorly.
Anyway, would it be much trouble to update the package to support PHP 8? Would be great!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.