We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23571
    • 223 Posts
    I just upgraded from Revo 2.1.1 to 2.1.2. I use FormIt 1.7.0 to handle a contact form. Once I upgraded my contact form disappeared. I use &emailTo=`[[getResourceField? &id=`1` &field=`email` &processTV=`1`]]` inside my FormIt call to return an email address that’s in a TV on a config page.

    This seems to resolve if I remove the getResourceField snippet call.

    The MODx error log reads: [2011-07-08 14:17:41] (ERROR @ /index.php) [OnLoadWebDocument]1
      • 23571
      • 223 Posts
      I have several of these in place (and get the same result each with each upgrade) and was able to upgrade the Formit as well as the MODx individually. The issue only occurs when using MODx 2.1.2 and Formit 1.7.0 and getResourceField 1.0.

      Almost forgot PHP 5.2.17, MySQL 5.0.90
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        I remember something with individual tag caching being fixed in 2.1.2..

        If you put the getResourceField out of the call - does it output what you expect it to?
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 23571
          • 223 Posts
          Yes, if I remove the getResourceField snippet call then everything behaves as it should.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            And you’re seeing the actual email address you want to send to where you put the getResourceField call instead?

            Now that I’m re-reading - your actual form goes blank? The entire page, or just the form? Is the form in a chunk, content, template? What’s your entire formit call?
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 23571
              • 223 Posts
              Yes, the entire form is not rendered. The page is rendered, just not the form.

              If I use [[!getResourceField? &id=`1` &field=`email` &processTV=`1`]] by itself in a content area this functions appropriately and returns the TV value, which is an email address.

              The code below is inside a chunk.
              <p>[[+fi.error.error_message]]</p>  
              <form action="[[~[[*id]]]]" method="post" class="form">  
                  <input type="hidden" name="nospam:blank" value="" />  
               
                  <label for="name">  
                      Your Name<br />
                      <span class="error">[[+fi.error.name]]</span>  
                  </label>
              
                  <input class="fd" type="text" name="name:required" id="name" value="[[+fi.name]]" />  
              <br /><br />
                  <label for="email">  
                      Your Email Address<br />
                      <span class="error">[[+fi.error.email]]</span>  
                  </label>
                
                  <input class="fd" type="text" name="email:email:required" id="email" value="[[+fi.email]]" />  
              <br /><br />
                  <label for="telephone">  
                      Phone Number<br /> 
                      <span class="error">[[+fi.error.telephone]]</span>  
                  </label>
              
                  <input class="fd" type="text" name="telephone:required" id="telephone" value="[[+fi.telephone]]" />  
              <br /><br />    
                  <label for="text">  
                      Questions/Comments<br /> 
                      <span class="error">[[+fi.error.text]]</span>  
                  </label><br /> 
                  <textarea name="text::stripTags" id="text" rows="7" value="[[+fi.text]]">[[+fi.text]]</textarea>
                
                  <br class="clear" />
              
                  <div class="form-buttons">  
                      <input class="button" type="submit" value="Submit" />  
                  </div>  
              </form>
              [[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`contactResponse` &emailTo=`[[!getResourceField? &id=`1` &field=`email` &processTV=`1`]]` &redirectTo=`11` &emailSubject=`Web Site Form Submission` &validate=`name:required,email:email:required,telephone:required`]]
              
                • 23571
                • 223 Posts
                Okay, I missed this one before. In my template, below the content call, I use the call: [[*id:is=`6`:then=`[[$contactForm]]`:else=``]]. This places the form just below the content area only on the appropriate page (ID #6). If I remove everything except [[$contactForm]], then the form is rendered appropriately.

                  • 23571
                  • 223 Posts
                  I think I was able to resolve this by changing my Formit call to cached:
                  [[FormIt? &hooks=`spam,email,redirect` &emailTpl=`contactResponse` &emailTo=`[[!getResourceField? &id=`1` &field=`email` &processTV=`1`]]` &redirectTo=`11` &emailSubject=`Web Site Form Submission` &validate=`name:required,email:email:required,telephone:required`]]
                  

                  Thanks for helping me look at this Mark!
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    Having FormIt caches will give you a lot of other issues, like not posting etc.

                    However I don’t see why your getResourceField shouldn’t be cached, as it’s unlikely that will change before the cache is cleared. And shouldn’t you be calling &isTV=`1` in there?

                    Did you check the error log?
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 23571
                      • 223 Posts
                      Okay, so I resume caching the FormIt snippet, I add the &isTV=`1`, and I tried setting getResourceField to cached and to uncached. My output is still an unrendered form. The only error I see is still the same as in my first post. Any ideas?

                      [[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`contactResponse` &emailTo=`[[!getResourceField? &id=`1` &field=`email` &processTV=`1` &isTV=`1`]]` &redirectTo=`11` &emailSubject=`Web Site Form Submission` &validate=`name:required,email:email:required,telephone:required`]]