We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1212
    • 4 Posts
    Hiall,

    I implemented a first multilanguage website with babel, and it worked pretty well. Thanks to the babel-creator and all who contributed!

    So I went on to implement a second multilanguage website with babel for which I enabled SEO friendly URLs according to http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html
    where the installation includes the definition of different contexts for different languages.

    On this website I also installed FormIt, which I used in other projects as well. However I could not successfully submit forms; of course I could push the button but an empty page did return; no email was sent nor errors loged; form could not redirect or display a message message.

    I tried turning off almost everything in the form like redirect, captcha, validation, reduction of number of fields, implementing the sample form from rtfm.modx.com without any luck. I installed BobRays QuickEmail and it worked, so it seems not to be an infrastructure problem.

    So I started over again, fresh MODX 2.2.0-pl install, only one single Add-On FormIt, and that worked well. So it's not a MODX issue.

    Again to better understand the possible cause I started over with a fresh MODX install, installed FormIt and Babel in two steps, while I stil could send forms. Then in order to have Babel work I enabled SEO friendly URLs and exactly then the form no longer worked. I could turn SEO friendly URLs off (always of course in backend and .htaccess) and the form worked again.

    I tried to debug a little bit, and I made a strange observation: in one of the FormIt classes there is a hasSubmission method which did return false even when submitting a form (with Babel installed and SEO friendly URLs enabled) and additionally at that code location I could not inspect the $_POST parameters, they seemed, not surprisingly after the hasSubmission method's return value, to be empty.

    I also tried BobRays SPForms in this install. Unfortunately these don't work either. Repeated the test with QuickEmail, it sends emails.

    I have no idea if I observed a problem in Babel or if I just forgot some configuration step. That's why I would be very glad for any hint or help. Thank you.

    Happy easter and best regards
    almo
      • 31946
      • 116 Posts
      Can you post your formit snippet call and the form code?
        • 1212
        • 4 Posts
        sorry, sure, the following is the formit snippet call and form code:

        [[!FormIt?
           &hooks=`spam,email,redirect`
           &emailTpl=`RegistrationEmailChunk`
           &emailTo=`[email protected]`
           &emailSubject=`Registration`
           &redirectTo=`21`
        &submitVar=`fname`
        &validationErrorMessage=`Please fill in name field.`
           &validate=`fname:required:stripTags` ]]
        
        [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
        
        <form action="[[~[[*id]]]]" method="post" class="form">
         <input type="hidden" name="nospam:blank" value="" />
        
            <label for="fname">
                Name:
                <span class="error">[[!+fi.error.fname]]</span>
            </label>
        
            <input type="text" name="fname" id="fname" size="35" value="[[!+fi.fname]]" />
        
            <input type="submit" value="Register me!" />
        
        </form>


        the above doesn't work, but I tried again with renaming .htaccess to ht.access and turning off SEO friendly URLs, then the above works
          • 31946
          • 116 Posts
          hmm..very strange. can you put a snippet before the FormIt call and check if you have the POST variables?
          <?php
          print_r($_POST);
          

          If you have no modx errors logged, can you check the error log of your server?
            • 1212
            • 4 Posts
            - print_r displays an empty array in a snippet;
            - also added this to index.php because to my understanding nothing may have happend,
            - replacing [[~[[*id]]]] with the page's alias /registration.html didn't change anything,
            - MODX and server error log are both empty,
            - I start thinking that maybe the error is in my .htaccess file (excerpt from it:)
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              • 15114
              • 102 Posts
              Hi almo

              I have the same problem, did you solve it ?

              Julien
                • 1212
                • 4 Posts
                Hi JuTs
                Unfortunately I didn't solve that problem yet.
                Wish you good luck.
                almo
                  • 15114
                  • 102 Posts
                  And have you used an other solution for the forms ?
                    • 15114
                    • 102 Posts
                    Hi,

                    That works now. I don't know how, I just tried to reinstall Formit and all seems to be OK.