We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: yurgeman at Oct 01, 2014, 06:11 AM
    Hey, did as you said. But then stopped sending email
    Then the hook somehow does not returns true. Any errors in the MODX system log?
      • 40957
      • 7 Posts
      Quote from: Jako at Oct 07, 2014, 10:51 PM
      Quote from: yurgeman at Oct 01, 2014, 06:11 AM
      Hey, did as you said. But then stopped sending email
      Then the hook somehow does not returns true. Any errors in the MODX system log?
      Modx error log and error log browser - completely empty
      Do I understand correctly that when using:
      &ajaxuploadFieldname=`image`

      chunk in an email message I have to insert a placeholder [[+image]]
      • O.k. Logs aren't written because the errors are returned with $hook->addError (https://github.com/Jako/AjaxUpload/blob/master/core/components/ajaxupload/elements/snippets/ajaxupload2formit.snippet.php#L54). Will add that too in next version.

        Do you get a white page (Status code 500) or some result with AjaxUpload2Formit in hooks parameter?
          • 40957
          • 7 Posts
          Quote from: Jako at Oct 08, 2014, 06:04 AM
          O.k. Logs aren't written because the errors are returned with $hook->addError (https://github.com/Jako/AjaxUpload/blob/master/core/components/ajaxupload/elements/snippets/ajaxupload2formit.snippet.php#L54). Will add that too in next version.

          Do you get a white page (Status code 500) or some result with AjaxUpload2Formit in hooks parameter?

          Changes introduced in the snippet, nothing has changed, there are no errors.
          Formit works through snippet AjaxForm. Files are loaded, but not embedded in the email
          &ajaxuploadFieldname=`image`

          chunk in an email message I have to insert a placeholder [[+image]]
          After submitting the form - the message is sent successfully, the message comes to the post office but the placeholder [[image]] - empty
          page of the form - zontmedia . ru - red button on top: "отправить заявку"
          • I use jquery-1.6.1.min.js, i don't see any JS error in the browser console. Nothing appears even in the source code.

            http://c3208.paas2.ams.modxcloud.com/form.html

            and the template is the one i posted yesterday. I've tried on 2 differents clouds on modxcloud and it is the same for both of us.
            Ajaxupload 1.1 and Formit 2.2.0 are installed.
            I know, it must come from my configuration, i miss something, but i can't find out what.
            • @hartus: Your template misses a closing body tag so MODX can't insert the scripts by regClientScripts before the closing body tag and the scripts are not loaded/executed.
              • Quote from: absent42 at Jul 09, 2014, 01:58 PM
                Well, for whatever reason it's not being passed on from either the snippet call or the default properties.

                Fixed with 1.1.1
                • Quote from: yurgeman at Oct 01, 2014, 06:11 AM
                  Hey, did as you said. But then stopped sending email

                  &hooks=`AjaxUpload2Formit,email`

                  AjaxUpload2Formit has to work before email - otherwise the image placeholder is not set in the email chunk. First update AjaxUpload to 1.1.1 and try it again. If no emails were sent after changing the hook order, there has to be an error in MODX system log.
                  • hello, sorry for the previous stupid question, i managed to make it works on both clouds.

                    I'm now trying to make it works with email and FormIt2db hooks.
                    But each time i upload a new file it delete the previous one, and i can't uplaod more than one file at once.

                    here is my formit call :
                    [[!FormIt?
                    &preHooks=`db2FormIt, Formit2AjaxUpload`
                    &hooks=`AjaxUpload2Formit,FormIt2db,email`
                    &ajaxuploadFieldname=`image`
                    &ajaxuploadTarget=`../images/assets/syltattoo/`
                    &ajaxuploadUid=`image`
                    &ajaxuploadFieldname=`image`
                    &packagename=`demandes`
                    &classname=`Demande`
                    &emailSubject=`Mtutu`
                    &emailTo=`[email protected]`
                    ]]

                    The form template :
                     
                        <h3>[[!+fi.successMessage]] [[+fi.error.error_message]]</h3>
                    <div class="wrap"><form action="[[~[[*id]]]]" method="post" enctype="multipart/form-data">
                    
                    <div id="name"><label for="name">Nom:</label></div>
                    <div class="controls"><input class="input-block-level" type="text" name="name" value="[[!+fi.name]]" /></div>
                    <div id="name"><label for="name">Email:</label></div>
                    <div class="controls"><input class="input-block-level" type="text" name="email" value="[[!+fi.email]]" /></div>
                    
                    <div id="description"><label for="description">Description:</label></div>
                    <div class="controls"><input class="input-block-level" type="text" name="description" value="[[!+fi.description]]" /></div>
                    <div id="name"><label for="name">Partie du corps:</label></div>
                    <div class="controls"><input class="input-block-level" type="text" name="partie" value="[[!+fi.partie]]" /></div>
                    <div>
                    <label for="image">Envoyez une image</label></div>
                    [[!AjaxUpload?
                    &uid=`image`
                    &thumbX=`75`
                    &thumbY=`75`
                    ]]
                    
                    
                    <input class="btn btn-primary" type="submit" value="Envoyer" /></form></div>

                    And this the kind of email i receive.
                    name: rzerezrezr
                    email: zerezrzer
                    description: zerzerzer
                    partie: zrzerzezer
                    image_fileid:0 file.name:
                    file.type:
                    file.tmp_name:
                    file.error: 4
                    file.size: 0
                    image: /assets/../images/assets/syltattoo/btnb_right.jpg

                    Did someone experienced something similar ? [ed. note: hartus last edited this post 9 years, 6 months ago.]
                      • 40957
                      • 7 Posts
                      Quote from: Jako at Oct 08, 2014, 01:31 PM
                      Quote from: yurgeman at Oct 01, 2014, 06:11 AM
                      Hey, did as you said. But then stopped sending email

                      &hooks=`AjaxUpload2Formit,email`

                      AjaxUpload2Formit has to work before email - otherwise the image placeholder is not set in the email chunk. First update AjaxUpload to 1.1.1 and try it again. If no emails were sent after changing the hook order, there has to be an error in MODX system log.

                      After the upgrade, there were errors:
                      [2014-10-10 17:23:10] (ERROR @ /home/zontmedi/public_html/core/components/ajaxupload/model/ajaxupload/ajaxupload.class.php : 82) PHP warning: Missing argument 1 for AjaxUpload::initialize(), called in /home/zontmedi/public_html/core/cache/includes/elements/modsnippet/70.include.cache.php on line 35 and defined