Git Product home page Git Product logo

Comments (6)

qzminski avatar qzminski commented on August 29, 2024

Thanks for reporting this issue and fixing it!

from contao-haste.

Toflar avatar Toflar commented on August 29, 2024

Not sure this is correct, Kamil. If what @formatz said is true, it's true for every form field, not only for the captcha field! So what your solution does is this:

// now works
$_SESSION['FORM_DATA']['captcha_myFormId'] = 'foobar';  // captcha form 1
$_SESSION['FORM_DATA']['captcha_myOtherFormId'] = 'barfoo'; // captcha form 2

// still doesn't work
$_SESSION['FORM_DATA']['myFormField'] = 'foobar'; // my form field of form 1
$_SESSION['FORM_DATA']['myFormField'] = 'foobar'; // my form field of form 2

Correct would be this

$_SESSION['FORM_DATA']['myFormId']['captcha'] = 'foobar';  // captcha form 1
$_SESSION['FORM_DATA']['myOtherFormId']['captcha'] = 'barfoo'; // captcha form 2
$_SESSION['FORM_DATA']['myFormId']['myFormField'] = 'foobar'; // my form field of form 1
$_SESSION['FORM_DATA']['myOtherFormId']['myFormField'] = 'foobar'; // my form field of form 2

from contao-haste.

qzminski avatar qzminski commented on August 29, 2024

I think the problem was with multiple captchas, as they were not validated correctly? @formatz, can you precise what was the problem?

from contao-haste.

formatz avatar formatz commented on August 29, 2024

Yes @qzminski , the problem was the validation.
Only the last Captcha key and data were saved in Session (they all overwrites the same key in session array).

from contao-haste.

Toflar avatar Toflar commented on August 29, 2024

Only the last Captcha key and data were saved in Session (they all overwrites the same key in session array).

But that's what I was saying. That's the case for all form fields that have the same name. So if you have two forms with the form field name vehicle, the second one is going to overwrite the first one :-)

from contao-haste.

formatz avatar formatz commented on August 29, 2024

Perhaps I don't understand your problem.
For me it doesn't matter that each forms contain the same input names because only the values from the submitted form are sent (each form id is unique and I can check the "FORM_SUBMIT" value).
(I compute the DCA values from a specific table. I didn't use the form generator)

from contao-haste.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.