We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hmmm...doesn’t seem to work.... huh


    I added some hard debugging myself to see what was passed to the function:


    echo ’From: ’ . $from;
    exit;

    and it outputs nothing!! $from is empty huh I wonder if it’s getting replaced (with nothing?) early somehow?
      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 30223
      • 1,010 Posts
      Stating the obvious maybe, but you do have a field called "email" in your form don’t you? What does &debug=1 (or 2 or 3) print out?
      • I sure do. Let me get that for you. Check your PM.

        Hmm...

        I even changed &from=`[+email+]` to read: &from=`you,[+email+],me`

        Then, in eform.inc.php, I run the following on line # 106:


        echo ’to: ’.$to.’<hr>’;
        echo ’from: ’.$from.’<hr><pre>’;
        print_r($fields);
        exit;

        this is the result:

        to: [email protected]
        from: you,,me
        
        Array
        (
        )
        
        


        [+email+] is gone!? So I took it to the snippet level and ran the following on line #93 of eForm snippet:

        print_r($params);
        exit;

        sure enough:
        [from] => you,,me
        


        What is going on! [+email+] isn’t even making it to function eForm(){ ... }
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 30223
          • 1,010 Posts
          Looks like part of your message doesn’t display smiley - perhaps one of the [ ] in the fields array plays havoc on the BB code parsing smiley I’ve edited your post and replaced some of the brackets.
          • Quote from: TobyL at May 17, 2007, 08:17 PM

            Looks like part of your message doesn’t display smiley - perhaps one of the [ ] in the fields array plays havoc on the BB code parsing smiley I’ve edited your post and replaced some of the brackets.

            oops..I may have deleted it. regardless, [+email+] doesn’t appear to even make it past [!eForm? ... ?
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
            • Quote from: TobyL at May 17, 2007, 08:28 PM

              Are you running this in 0.96 ?. Here’s an outrageous little test.

              Instead of having &from=`[+email+]` make it &from=`((email))` and update line 420 to read
              <?php
              $from = str_replace('((email))',$fields['email'],$from);
              ?>
              


              Does that work? If so I have the suspicion that the order in which place holders are evaluated has changed and the [+email+] is replaced before eForm sees it.

              Sure enough. That worked. Hmm...it appears this is isolated to an 096 issue. Almost as if 096 parses snippet calls differently (processing order?) ...specifically noticable with snippets that have placeholders in the call. Any placeholder I pass as a snippet param is removed prior to even hitting the snippet-level...this is not the case on my 0.9.5[.1] build sites...hmmm

              This might explain why my eForm 1.4.2 theory didn’t work as intended (on 096) ...It is functioning fine, however, on 095 :/
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
              • I think the problem you are running into is that your are calling $modx->stripTags() which erroneously did not remove placeholder tags, until revision 2166 from netnoise...
                Index: /tattoo/branches/095dev/manager/includes/document.parser.class.inc.php
                ===================================================================
                --- /tattoo/branches/095dev/manager/includes/document.parser.class.inc.php (revision 2033)
                +++ /tattoo/branches/095dev/manager/includes/document.parser.class.inc.php (revision 2166)
                @@ -2219,4 +2219,5 @@
                         $t= preg_replace('~\[\!(.*?)\!\]~', "", $t); //snippet
                         $t= preg_replace('~\[\((.*?)\)\]~', "", $t); //settings
                +        $t= preg_replace('~\[\+(.*?)\+\]~', "", $t); //placeholders
                         $t= preg_replace('~{{(.*?)}}~', "", $t); //chunks
                         return $t;


                If you can confirm this is the issue, and want to submit a patch for 0.9.6 final release, you have 2 hours. Ha ha...just kidding (not really) laugh

                EDIT: by patch, I mean a patch of eForm...
                • Jason, Please see your PM. I have provided a link with a generic test case, not specific to eForm.

                  btw, I am confirming as we speak.

                  UPDATE:

                  I have commented out the PH section from stripTags:


                  # Remove unwanted html tags and snippet, settings and tags
                  function stripTags($html, $allowed= "") {
                  $t= strip_tags($html, $allowed);
                  $t= preg_replace(’~\[\*(.*?)\*\]~’, "", $t); //tv
                  $t= preg_replace(’~\[\[(.*?)\]\]~’, "", $t); //snippet
                  $t= preg_replace(’~\[\!(.*?)\!\]~’, "", $t); //snippet
                  $t= preg_replace(’~\[\((.*?)\)\]~’, "", $t); //settings
                  //$t= preg_replace(’~\[\+(.*?)\+\]~’, "", $t); //placeholders
                  $t= preg_replace(’~{{(.*?)}}~’, "", $t); //chunks
                  return $t;
                  }

                  However, it didn’t appear to have corrected the issue... hmmm
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                    • 30223
                    • 1,010 Posts
                    @Jason, eForm only uses $modx->stripTags() on the POSTED values and not on the variables it receives from the snippet call so there must be something else going on.

                    Edit: Didn’t see pixel’s edit, so ignore me smiley
                    • Yeah, I see that now, but can’t see anything else obvious in the parser logic that has changed... huh