We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12712
    • 7 Posts
    I made a custom, multilingual web form for users to submit requests for brochures. The submitted data is stored in a database table.

    I had the form submit to itself at first, but I had a problem where the snippet got parsed twice, once for each language, resulting in double database entries. I moved the snippet into a separate monolingual template page and I’m still having this issue. I assume this double insert is caused by the YAMS plugin. Has anyone else run into this issue? Is there a workaround?

    My current solution is to drop a cookie with a random string md5(time()) when the form loads and storing this hash as a unique field in the database along with the information. The same cookie will get inserted twice, and the database will enforce the unique requirement so the data won’t actually be stored twice. It’s not particularly elegant though so I’m looking for other solutions.

    Thanks in advance!

    EDIT: I think I was a little premature in posting this thread... I tested again more carefully using both 1.1.8 and 1.1.9 and tt actually does work fine if you have a multilingual form submit to a monolingual document that handles the database stuff. Passing error messages back is more cumbersome this way though.
      • 22851
      • 805 Posts
      Quote from: igowerf at Jun 01, 2010, 05:59 PM

      EDIT: I just upgraded to version 1.1.9 and it seems to be resolved!
      Really?! That’s good news I guess.

      Please could you tell me which version of YAMS you upgraded from so that I can track down which change fixed it? I was aware that there was an issue whereby uncacheable snippets for all language variants could be executed even though only one language appears in the final output. This was causing problems for the FirstChildRedirect snippet, for example. However, I wasn’t aware that I had got around to fixing that particular issue yet!
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 12712
        • 7 Posts
        Actually, I’m not sure if it’s fixed for multilingual documents, but it works great now if I submit the information to a monolingual document that handles the database operations. I was running 1.1.8.

        I thought that using the monolingual document to handle the database stuff had fixed it, but I thought I saw the double inserts again this morning. Thinking over it now, I’m not sure if I was just looking at some old database records...

        Sorry about this haphazard bug report, but I’m trying to get this site done for a launch later this week. undecided

        EDIT: Switched back to 1.1.8 and tried my form again. It looks like the double insert was NOT happening with the monolingual document. Bla. Sorry about this confusion.
          • 22851
          • 805 Posts
          Okay. That’s fine. The important thing is that it’s still an issue for multilingual documents that I need to investigate. Thanks for the update, it helps pin the issue down.
            YAMS: Yet Another Multilingual Solution for MODx
            YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
            Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.