We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Call-time pass-by-reference is an option in PHP ini, and is deprecated in the most recent releases of PHP 4.4.x and 5.x. Parameters that should be passed by reference must be passed normally and treated as a reference when defining the function parameters in order to work in all environments....e.g.

    <?php
    if ($eFormOnMailSent) {
        if ($eFormOnMailSent(&$fields)===false) return;
    }
    ?>


    should be changed to

    <?php
    if ($eFormOnMailSent) {
        if ($eFormOnMailSent($fields)===false) return;
    }
    ?>


    And the function defined as $eFormOnMailSent should be defined with a reference marker for the accepted parameter, expected to be treated as a reference... e.g.
    <?php
    $eFormOnMailSent= 'myCoolFunctionName';
    function $eFormOnMailSent(& $fields) {
        //code to manipulate the variable treated as a reference goes here
    }
    ?>
      • 17058
      • 80 Posts
      Hi everybody,

      got a strange error by using the eForm-snippet on an (older) MODx TP3.2 (x2) installation.
      after installation the snippet (zip from the 1st post, no modifications) and moving the eform.inc.php-file in the correct folder, a parse error appears.

      it looks in this way:
      « MODx Parse Error »
      MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »

      PHP error debug
      Error: Unknown(/www/htdocs/mydomain/assets/snippets/eform/eform.inc.php): failed to open stream: No such file or directory
      Error type/ Nr.: Warning - 2
      File: /www/htdocs/mydomain/manager/includes/document.parser.class.inc.php(667) : eval()’d code
      Line: 192

      The Server(Linux/apache) is running on PHP Version 4.4.1.

      Is this a server issue or depends the error on the modx-version?
      Thanx, le block.

      btw: Does the zip in the 1st posting contain all the nice modifications, that follow in all next postings?
        le_block is Member of FUTY | Medienagentur aus Leipzig mit Schwerpunkt Marketing, Branding, Print und Webdesign
        • 11588
        • 6 Posts
        Thanks for the solution, OpenGeek. smiley
          • 30223
          • 1,010 Posts
          Error: Unknown(/www/htdocs/mydomain/assets/snippets/eform/eform.inc.php): failed to open stream: No such file or directory

          Your server thinks the file is not there so either you put it somewhere else then in /www/htdocs/mydomain/assets/snippets/eform/ or the server can’t see it in which case you might want to check the permissions on the file...
            • 17058
            • 80 Posts
            @TobyL: But how to prevent this error? I copied the file outside the eForm folder (because, it’s default by the installation-process) and gave both (inside and outside) a CHMOD777. the error is still there.

            I did a quick install of the eForm on a local testing evironment (mod X0.91 - win,apache,php 5.0.5 ) everything works fine.
            Mentioned above, i guess its either a version problem or a server issue (of my ISP).

            Any other ideas?

            thanks, le block
              le_block is Member of FUTY | Medienagentur aus Leipzig mit Schwerpunkt Marketing, Branding, Print und Webdesign
              • 661
              • 33 Posts
              For whatever reason(s), I can’t get this snippet to work. If someone could take at my code (below), I’d appreciate it. I think I’ve been staring at code for too long.

              Code for "contactForm" chunk
              <form name="contactForm" id="contactForm" action="" method="post">
              <input type="hidden" name="formid" value="contact" />
              
              <fieldset id="textfields">
              <label for="name">
              Name: <input type="text" name="name" id="name" size="24" value="[+name+]" />
              </label>
              
              <label for="email">
              Email: <input type="text" name="email" id="email" size="24" value="[+email+]" />
              </label>
              
              <label for="phone">
              Phone: <input type="text" name="phone" id="phone" size="24" value="[+phone+]" />
              </label>
              
              </fieldset>
              
              <p>Please indicate what types of services you are interested in, and I will get back to you with additional information via phone or email.</p>
              
              <!-- checkboxes will be inserted here eventually -->
              
              <fieldset id="textarea">
              <label for="comments">
              Additional questions / comments:
              <textarea name="comments" id="comments" rows="9" cols="40">[+comments+]</textarea>
              </label>
              </fieldset>
              
              <fieldset id="send">
              <input type="submit" name="send" value="Send!" />
              </fieldset>
              </form>
              


              code for "contactReport" chunk
              (*I realize this isn’t complete HTML - I just wanted something quick for testing.)
              [+name+]<br />
              [+email+]<br />
              [+phone+]<br />
              [+comments+]
              


              code for snippet, which I’ve put in the appropriate template.
              [[eForm? &formid=`contactForm` &to=`[email protected]` &gotoid=`1` &tpl=`contactForm` &report=`contactReport` &format=`name:Name:string:1,email:Email:email:1,phone:Phone:string:0,comments:Comments:string:0` ]]
              
                • 33372
                • 1,611 Posts
                I think that this:
                <input type="hidden" name="formid" value="contact" />

                should be this:
                <input type="hidden" name="formid" value="contactForm" />

                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 661
                  • 33 Posts
                  Fixed that. Still doesn’t work. In fact, I’ve got it set to go to the home page (id 1) after sending and it doesn’t. It just re-displays the form with all fields blank.

                    • 32963
                    • 1,732 Posts
                    Quote from: aherrera at May 31, 2006, 04:49 PM

                    Fixed that. Still doesn’t work. In fact, I’ve got it set to go to the home page (id 1) after sending and it doesn’t. It just re-displays the form with all fields blank.



                    Ah! You have cache enabled?
                      xWisdom
                      www.xwisdomhtml.com
                      The fear of the Lord is the beginning of wisdom:
                      MODx Co-Founder - Create and do more with less.
                      • 661
                      • 33 Posts
                      DOH! grin

                      Thanks... that was the problem.

                      This discussion is closed to further replies. Keep calm and carry on.