• So i’m changing the upload path in a gravity form through a hook. This works perfectly when used normally but if the form is in an inline fancybox it doesn’t work. It just gets stuck uploading.

    I know the code to change the path is correct. Fancybox is interfering in some way.

    Any ideas?

    the code i’m using to change the path in funtions.php is:

    add_filter( 'gform_upload_path', 'wdw_change_upload_path3', 10, 2 );
    function wdw_change_upload_path3( $path_info, $form_id ) {
    	if ($form_id == 9 ){
    	   $page_id  = get_the_ID();
    
    	   //get Paciente Info
    	   $row13=$wpdb->get_row("SELECT nombre, apellido1, apellido2, clienteID FROM siodental_com.Paciente WHERE pageID='$page_id'");
    
    	   $nombre = $row13->nombre;
           $apellido1 = $row13->apellido1;
           $apellido2 = $row13->apellido2;
    	   $clienteID = $row13->clienteID;
    	   $upload_dir = wp_upload_dir();
    	   $path_info['path'] = $upload_dir['basedir'].."/Subidas_cliente/$clienteID/$nombre"."_".$apellido1."_".$apellido2."/";
           $path_info['url'] = $upload_dir['basedir']."/Subidas_cliente/$clienteID/$nombre"."_".$apellido1."_".$apellido2."/";
        	}
    		return $path_info;
    
    }

    The code I’m using to call the fancybox is:

    //Upload more pics
    echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-3">';
    echo do_shortcode('[gravityform id="9" ajax="true"]');
    echo '</div></div><a href="#fancyboxID-3"><input class="button small default comment-submit blue" name="submit" type="submit" id="submit" value="Subir mas fotos"></a>';

    https://wordpress.org/plugins/easy-fancybox/

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have no idea how fancybox would be interfering with that. The inline content stays on the same page, if it’s inside the hidden div or inside the lightbox frame that does not matter.

    Can you share a link?

    Thread Starter bertini

    (@bertini)

    The website i’m creating is siodental.com but it’s kind of annoying to get to the page i’m interested in (you’d have to fill many forms to register and it’s all in spanish…)

    The reason I think fancybox is interfering is because I change the upload the path in a plain form and it works. Whenever I put the shortcode in the fancybox it doesn’t :/

    I know it doesn’t really make sense…

    Thanks anyway.

    Thread Starter bertini

    (@bertini)

    I’ll try to add it to the home page so you can see the problem easily. One sec!

    Thread Starter bertini

    (@bertini)

    Thread Starter bertini

    (@bertini)

    I added a fancybox button to the homepage under the slider called SUBIR MAS FOTOS.

    There is something strange going on but I do not think it has to do with the path. I tried uploading an 3.9Mb FLV file and it loaded up to 100% after which the form replied it was not if the correct type and I should submit .jpg or other image types in Spanish, obviously 😉

    Then I tried a 3.8Mb JPG file and that starts uploading, but after it reached 100% nothing happens…

    It feels like the success response message does not reach the form while the error response does. No idea if this also means that any follow-up file processing is aborted after a succesful upload.

    Thread Starter bertini

    (@bertini)

    Okay i’ll look into that tomorrow.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Upload path change’ is closed to new replies.