We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34004
    • 125 Posts
    I've been trying several things with formit and there doesn't seem to be any errors or any sort of error log which gives a hint what is wrong - it just doesn't work.

    Am I missing something? Is there a way to debug with FormIt?
      • 4172
      • 5,888 Posts
      if you're talking about formit-hooks, I like to output debuggings into a chunk with something like this code:

      $values = $hook->getValues();
      $debug['values'] = $values;
      
      if ($chunk = $modx->getObject('modChunk',array('name'=>'debug'))){
          $chunk->setContent($chunk->getContent().print_r($debug,1));
          $chunk->save();
      }


      don't forget to create a chunk with name 'debug' first.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 34004
        • 125 Posts
        I was actually just talking generally - I have just managed to get the example form working at http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page only by removing the spam and recaptcha hooks. As soon as I add them it breaks - and there's no clue as to what exactly is wrong, no php errors, etc.

        Just wondering if I am missing some sort of debugging mode at all?
          • 3749
          • 24,544 Posts
          AFAIK, Bruno17's method is the only way to debug what happens in hooks and prehooks.

          Do you have a password manager that could be filling in the hidden spam field? If the spam hook crashes, the recapta hook won't execute.


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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