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

    Hi FormIt guru’s smiley I’ve just installed this great little package on Revolution (thanks Shaun McCormick!), and it was working beautifully on my localhost environment - the form output was correct and emails were sending fine.

    However since I moved the site across to a live environment FormIt no longer works and is outputting code where it should be outputting plain text, e.g below or see the attached screenshot.

    name[[+fi.error.name]]
    [[+fi.name]]
    email[[+fi.error.email]]
    [[+fi.email]]
    message[[+fi.error.text]]
    [[+fi.text]]

    Instead of...

    name (please enter your name)
    __________________________________
    email (please enter a valid email)
    __________________________________
    message (please enter your message)
    __________________________________

    Things I’ve tried so far:
    - Uninstalling and removing FormIt and reinstalling from the modx package server
    - Removing the ! cache command (with limited success)
    - Trying out the exact example on http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page with ! cache enabled, and disabled. The same problems occur.

    My template code

    [[FormIt?
       &hooks=`email,redirect`
       &emailTpl=`sent_email_template`
       &emailTo=`[email protected]`
       &emailSubject=`Enquiry via website`
       &redirectTo=`25`   
       &validate=`name:required,
    	      email:email,
    	      text:required`
        ]]
    
        [[+fi.error.error_message:notempty=`<p class="error">[[+fi.error.error_message]]</p>`]] 
    
        <form action="[[~[[*id]]]]" method="post" id="contact-form">
    
            <label for="name" >Name<span class="error">[[+fi.error.name]]</span></label>
            <input type="text" name="name" maxlength="60"  value="[[+fi.name]]" />
    
            <label for="email" >Email<span class="error">[[+fi.error.email]]</span></label>
            <input type="text" name="email" size="40" maxlength="40"  value="[[+fi.email]]" />
    
            <input type="hidden" name="phone" value="" /> 
    
            <label for="text">Message<span class="error">[[+fi.error.text]]</span></label>
            <textarea cols="40" rows="7" name="text" value="[[+fi.text]]">[[+fi.text]]</textarea>
    
            <input type="image" name="submit" class="submit" alt="Send" src="assets/images/global/send.png" />
    
        </form>
    


    Chunk - sent_email_template

    <div style="font-family: Arial; font-size: 12px;" />
        <p>The following message was sent via the website.</p>
        <p><strong>[[+name]]</strong> at <strong>[[+email]]</strong> wrote:</p>
        <p>[[+text]]</p>
        <p>You can reply to <strong>[[+name]]</strong> at <strong>[[+email]]</strong></p>
    </div>
    


    Here’s my current specs on the live environment:

    modx Revolution 2.0.7-pl (traditional)
    PHP version 5.2.14
    Note - My localhost PHP version is 5.3.1
    MySQL version 5.0.91 (?)
    PDO support - enabled
    No opcode caching in use that I know of


    Any help you can give me would be very greatly appreciated!

    Thanks
    Harmony
      • 28215
      • 4,149 Posts
      Those tags should definitely be getting parsed.

      1. Try clearing out the core/cache/ directory.
      2. Try re-running setup/ for Revo after moving it. This might fix some path issues you might be having.
      3. If that doesn’t work, ensure you copied over all the files in core/components/formit/, and check core/cache/logs/error.log for any errors.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3749
        • 24,544 Posts
        Did you edit with TinyMCE? It may have munged up your code.

        BTW, you definitely want the ! in the snippet tag (and the ?).
          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
          • 34108
          • 66 Posts
          Thanks for the quicky reply Shaun! (also just installed and used batcher - another brilliant package, thank you).

          I just tried all those three things and no luck I’m afraid, FormIt still doesn’t seem to be working - http://www.thespottedquoll.com.au/contact

          Any thoughts on further troubleshooting / fixes I could try?

          Thanks
          Harmony
            • 34108
            • 66 Posts
            Quote from: BobRay at Jan 19, 2011, 05:00 AM

            Did you edit with TinyMCE? It may have munged up your code.

            BTW, you definitely want the ! in the snippet tag (and the ?).

            Thanks Bob smiley No I haven’t done any editing of this page with TinyMCE, it’s all controlled through the page template. Also when I include ! in the snippet call it’s even worse - spits out the whole snippet as code (which is why I thought it might be related to a caching issue?) - http://www.thespottedquoll.com.au/contact
              • 3749
              • 24,544 Posts
              Are other pages with (non-FormIt) snippets working OK?

              Try a page with:

              [[!Test? &string=`Testing`]]


              And a snippet called Test with this code:

              <?php
              $output = '<p>In the Test Snippet</p>' ;
              $output .= '<p>Parameter: ' . $string . '</p>';
              $output .= '<p>Site name:  [[++site_name]]</p>';
              return $output;
              
                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
                • 34108
                • 66 Posts
                Thanks heaps for your help Bob! Yes there’s a number of other snippets in the site which are all working fine, although all of them are having to be called uncached.

                When I tested that snippet I get the following results:

                Works fine
                [[Test? &string=`Testing`]]
                produces
                In the Test Snippet
                Parameter: Testing
                Site name: The Spotted Quoll Studio

                Doesn’t work
                [[!Test? &string=`Testing`]]
                produces
                [[!Test? &string=`Testing`]]
                  • 28215
                  • 4,149 Posts
                  Okay, something’s definitely weird with your caching system. Did you change any of the caching options in System Settings? Also, do you have eAccelerator, APC, winCache, etc on? Anything else odd about your system we should know about?
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 34108
                    • 66 Posts
                    Quote from: splittingred at Jan 19, 2011, 10:50 PM

                    Okay, something’s definitely weird with your caching system. Did you change any of the caching options in System Settings? Also, do you have eAccelerator, APC, winCache, etc on? Anything else odd about your system we should know about?

                    No none of the above, and nothing else weird about this particular site or install that I know of sorry. It’s ok, I’ll try that other form app as this is probably an isolated bug specific to this install or this website.

                    Thank you both again for your help smiley
                      • 3749
                      • 24,544 Posts
                      I wonder if the code that inserts ’<?php’ at the top of cached snippets is munged. I’m not sure where to look for that.
                        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