image captcha reload

Created on 22 November 2024, 4 months ago

hi.
drupal 10.3.8
php 8.3.6
update captcha to 2.0.7
erro in capcha reload and show this message ;

{"status":1,"message":"","data":{"url":"\/image-captcha-generate\/19\/1732275322","token":"37NDuQbGZHTvQyC9u3_RdHaRgyBZoyS8jCne2WjmQ6I","sid":"19"}}

🐛 Bug report
Status

Active

Version

2.0

Component

Image Captcha (image_captcha)

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bolaghi
  • 🇮🇳India arunsahijpal

    Hi @bolaghi,
    I've tested it on
    drupal 10.3.9
    php 8.3.14
    captcha 2.0.7

    and it does not show any error.

  • 🇦🇹Austria jordik

    Same error as in the description.
    drupal 10.3.10
    captcha 2.0.7

    Reverting to captcha 2.0.6. makes the error disappear and captcha refreshes as expected.

  • 🇦🇹Austria jordik

    The image_captcha_refresh.js was changed in 2.0.7 to return "FALSE" instead of "false" which causes a JSON error (can only handle lowercase booleans).
    Changing it back to "false" resolves the issue.
    MR created.

  • Pipeline finished with Success
    4 months ago
    Total: 312s
    #353721
  • thank you @jordik , #5 Fixed the problem.

  • Hi,

    Drupal 11.0.9
    PHP 8.3.6
    Captcha 2.0.7

    The problem still exists even after I changed FALSE to false in the image_captcha_refresh.js file as described in #5.

  • 🇮🇳India suraj_vantagode

    Hi,

    Facing the same issue with the below versions:
    Drupal 10.3.8
    PHP 8.1.31
    Captcha 2.0.6

    The image_captcha_refresh.js is already set as "false", but I am still facing an issue.

  • 🇦🇹Austria jordik

    Try rebuilding the cache and then refreshing the page.

  • 🇺🇸United States shasha821110

    the change from 'FALSE' to 'false' works for me. Thanks.

  • Status changed to Needs review 2 months ago
  • The error mentioned in #4 is more than obvious. The file image_captcha_refresh.js is a Javascript file and in javascript FALSE is not a boolean literal. The error is confirmed also by web browsers. The Javascript engine throws the following exception that can be seen in the Console when it encounters FALSE:

    Uncaught ReferenceError: FALSE is not defined
        at HTMLAnchorElement.<anonymous> (image_captcha_refresh.js?v=10.4.1:47:9)
        at HTMLAnchorElement.dispatch (jquery.min.js?v=3.7.1:2:40035)
        at v.handle (jquery.min.js?v=3.7.1:2:38006)
    (anonymous) @ image_captcha_refresh.js?v=10.4.1:47
    dispatch @ jquery.min.js?v=3.7.1:2
    v.handle @ jquery.min.js?v=3.7.1:2Understand this errorAI

    By changing FALSE to false the problem is solved.

    If you make this change then reload the page with "CTRL + SHIFT + R" in order to load the changed version and not the version cached by your browser.

  • 🇻🇳Vietnam tamnv

    Hi

    I created a patch for changing from FALSE to false which work well from our side

  • 🇺🇸United States cgrouge

    Confirming the patch in #14 changing FALSE to false fixes the error for me.

    Drupal 10.3.9
    Captcha 2.0.7

  • Re: #11 🐛 image captcha reload Active

    After rebuilding the cache and refreshing the page, the issue has indeed been resolved. Thank you!

Production build 0.71.5 2024