We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Had a form working ok - I thought - had to make some changes and then ran test only to discover that form was not redirecting as stated in hooks. My call is:

    [[!FormIt? &hooks=`recaptcha,spam,email,redirect` &validate=`workemail:blank` &emailUseFieldForSubject=`1` &emailTpl=`emailResponse` &emailTo=`[email protected]` &redirectTo=`3`]]

    The form does submit and an email is sent but the page is not redirected, it simply reloads. The following error is logged:

    [2010-12-07 13:14:22] (ERROR @ /index.php) [FormIt] Could not find hook "redirect` ".

    I checked a couple of other sites in which I was using recaptcha and the same error has arisen. I’ve now removed recaptcha and will investigate the &hooks=`math` instead, but just wondered if there was a reason for the above.

    Thank you cool
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 20014
      • 200 Posts
      don’t know if this has anything to do with above problem, but it may so I’ll post what has been happening with me since I just updated Formit(1.5.0 rc2). again, not trying to hijack the thread, just thought perhaps both are somehow related

      I am getting an error message on reCaptcha even though I put the correct words in the form.
      The reCAPTCHA wasn't entered correctly. Go back and try it again. 


      I am on my localhost still and have yet to update Formit on other sites which are live, but prior to the update, the email form would redirect fine, the private and public keys are correct, yet I still get the above errors.

      the site was in its last stage before going live so I am hoping someone knows what is wrong or what I have done wrong, the only other thing I have done since was set the settings via manager to smtp to test the email form on my local environment. setting the system settings back to default, results in the same error message.
      EDIT:
      the recaptcha with the same public and private keys work just fine with login, but not formit
      also just saw the post on update to revo thought perhaps that shaun updated Formit for this, I updated my install, flawless as always (thanks guys) but still same error, been scroogling like crazy but can’t seem to see where the error is.
      also, just to make sure, I went to rtfm, used the snippet call and the template example, same problem and after hitting the submit button, it stalls and leaves a blank page, with a refresh I see the reCaptcha error is the same.
        • 20014
        • 200 Posts
        EDIT: my apologies to the OP, I should have posted my own thread, perhaps a mod could do me the favor? rolleyes

        I am not sure what’s going on, I have returned system settings for smtp back to default,
        uninstalled formit, cleared cached and even cleared my browsers cache,
        removed the recaptcha fromt the hook and used math and included the proper code from rtfm
        the from doesn’t redirect
        cleared the math fromt he hook and left the form without any spam protection except for the hidden empty field, again no redirect.

        I repeated this process with the example contact form template provided on RTFM and the call as well, recaptcha says I am entering the wrong words,
        and with math the form the page seems to reload and the form fields are left populated with no error messages, and without anything at all except the pure sample email template from rtfm, no redirect at all and the form fields are left populated with no error messages.

        tried an uninstall rollback, but unfortunately the last one to work was 1.4.1

        so as I said I am on the latest revo, using the rtfm form and call, so it can’t be the form or call itself, a copy a paste job and the call is set on a page which is set to be not rich text, have cleared cache between each action

        the only error in the log is
        [FormIt] An error occurred while trying to send the email. Could not instantiate mail function.
          • 3749
          • 24,544 Posts
          I’ve experienced some funkiness lately with $modx->sendRedirect() in some browsers, which is used to forward you to another document. I believe it’s been fixed in 1.0.5, but I haven’t had occasion to test it.

          Also, it’s always worth it to try clearing the site cache and your browser cache and cookies in cases like this.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 28215
            • 4,149 Posts
            Can you file that here: http://github.com/splittingred/FormIt/issues/ and we’ll try and take a look at it?
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 20014
              • 200 Posts
              ok have put the info on github, and note, I noticed that there was another update to Formit (1.5.2, cleared cache, closed browser and opened several other browsers, ie8, chrome, safari, opera, and retested. all had the same issue, recaptcha stating error on the words entered, I then rid the template of
              [[+formit.recaptcha_html]] [[+fi.error.recaptcha]] 
              and rid the hook of recaptcha and tested to see about the redirect issue, again in all browsers with no recaptcha, there is no redirect and the fields are still left populated,
              the above is the only thing I have done since logging into manager, the first error, there are several dozen, the last is when I tried to submit the forms. Errors are as follows:
              [2010-12-09 12:31:56] (ERROR @ C:\site_development_folder\client_site\core\xpdo\xpdo.class.php : 1877) PHP warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: recursion detected
              [2010-12-09 12:33:47] (ERROR @ /client_site/index.php) [FormIt] An error occurred while trying to send the email. Could not instantiate mail function.

                • 20014
                • 200 Posts
                UPDATE: for some reason after the install on 1.5.2 this mourning, I was receiving the same recaptcha errors, I had cleared the cache, and tried on several browsers, I had to shut down for awhile and when I cam back to work on the problem, I am no longer getting the error from recaptcha, it seems the only issue is really the redirect now and the form still being populated after sending the message. will mention this on github
                EDIT:
                Just tried the math hook no go, redirect issue persists even without math and recaptcha present in the &hook call
                error log continues:
                [FormIt] An error occurred while trying to send the email. Could not instantiate mail function.


                I post this simply for anyone who is also having the same issue as the OP and myself.

                just a question: I have 1.4.1 installed on other sites on my localhost and all the live sites running 1.4.1 have no hiccups whatsoever, is there anyway to take the formit files from one of those and somehow install them on this installation of revo? have tested those forms on my localhost and they all redirect