- Issue created by @Anybody
- 🇩🇪Germany jurgenhaas Gottmadingen
This is because the
friendlycaptcha_captcha_validation($solution, $response, $element, $form_state)
method overrides the$response
variable if it's NOT the local endpoint, and that response is later used for retrieving the response code for a logging message.That said, there are 2 items to resolve:
- A method variable should never be overridden, especially not with a value of a different type. For that, a different variable name should be used.
- The logger message should be different for local endpoint and others, since there are different context variables available for both.
- Status changed to Needs review
7 months ago 10:54am 16 April 2024 - 🇮🇳India Rajan Kumar@2026
hii @Anybody
this error "Error: Call to a member function getStatusCode() on string in friendlycaptcha_captcha_validation()" , handle by added code.
- Status changed to Needs work
7 months ago 6:33am 17 April 2024 - First commit to issue fork.
- 🇩🇪Germany Grevil
Fixed! And tested with both the local and global endpoint, on both successful and unsuccessful result, as well as invalid API key.
Works great! :)
We are currently constructing the error message, even if the result is successful, this could be seen as a point of improvement, but this way, we don't need to create another if else case after the successful result check.Please review!
- Status changed to Needs review
7 months ago 9:13am 17 April 2024 - 🇩🇪Germany Grevil
It might also make sense to log the user, if the error appears, but since captcha is often used for login, we might get a lot of anonymous user logged, but it is still a possibility, while we are at it!
- Status changed to Needs work
7 months ago 9:46am 17 April 2024 - Status changed to Needs review
7 months ago 9:54am 17 April 2024 - Status changed to RTBC
7 months ago 9:57am 17 April 2024 - Status changed to Fixed
7 months ago 11:57am 17 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.