• Resolved troypouliot

    (@troypouliot)


    Hi

    I have a customer that is getting an error when trying to checkout with photos uploaded. This is using the image cropper input type.

    The error is;
    rename(/home/customer/www/talkinghands3d.com/public_html/wp-content/uploads/ppom_files/,/home/customer/www/talkinghands3d.com/public_html/wp-content/uploads/ppom_files/confirmed/1361/1173-): Invalid argument in /home/customer/www/talkinghands3d.com/public_html/wp-content/plugins/woocommerce-product-addon/inc/files.php on line 384

    The section of code from the files.php file is;

    	// Check if file not yet moved to confirm then move it.
    	if( file_exists($base_dir_path) ) {
    		if(rename ( $base_dir_path, $confirmed_dir_path.$file_name)) {
    			$file_download_url_found = $ppom_dir_url .'confirmed/' .$order_id .'/' . $file_name;
    		}
    	} else if( file_exists($confirmed_dir_path.$file_name) ) {
    		$file_download_url_found = $ppom_dir_url .'confirmed/' .$order_id .'/' . $file_name;
    	} else if( file_exists($edits_dir_path) ) {
    		$file_download_url_found = $ppom_dir_url . 'edits/' . $file_name;
    	}
    	
    	return apply_filters('ppom_file_download_url', $file_download_url_found, $file_name);

    Can you please see if there is a solution so that I can continue to take orders?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @troypouliot,

    ok let me see, the only specific customer getting this issue?

    Thread Starter troypouliot

    (@troypouliot)

    Yes, so far. This is a new product and this is only the 2nd customer to place an order. The 1st customer did not have this issue. I’ve tested placing orders on both desktop and mobile and can’t get the error.

    I’m trying to get more info from the customer on the file specifics for which they uploaded (file name, size).

    Along those lines, are there any restrictions or limitation on file names (characters, length) for file uploads that could cause this error?

    Thread Starter troypouliot

    (@troypouliot)

    Also, please see image below of the previously uplaoded image files thru the image cropper input type.
    Does PPOM assign the random file names like you see below? Or is this the Optimole optimization plugin doing that?
    PPOM uploaded file names

    • This reply was modified 4 years, 4 months ago by troypouliot.
    Thread Starter troypouliot

    (@troypouliot)

    Ok, so I’ve done some more troubleshooting. Luckily the customer in this case is a family member.

    The error message comes up and the checkout fails if the user tries to checkout with more than 1 item.
    If only 1 item is purchased at a time then it works fine.
    Please help

    Hi,

    you mean two products in a cart with different cropped images?

    Thread Starter troypouliot

    (@troypouliot)

    Correct

    Thread Starter troypouliot

    (@troypouliot)

    I think I’m starting to narrow down what is going on.
    A lot of times now I get this error when trying to checkout
    “SyntaxError: Unexpected token < in JSON at position 0”

    When I look at the chrome dev tools there is a resource that returns a 404 error.
    I think this is what is throwing the JSON error.

    I noticed that after adding my product to the cart there are 2 extra icons under the original photo and the cropped photo. You can see that one of them is the broken resource.

    What are these and how can they be removed?

    Please see image here –
    https://talkinghands3d.com/wp-content/uploads/2020/11/JSON-error.jpg

    Thread Starter troypouliot

    (@troypouliot)

    Sorry to keep adding to this but I have found what I think is causing the error and this is something that should be added to the image cropper tool.

    In the image cropper tool, you can add different “options” in the form of “viewport sizes”
    The problem is that you cannot set any of these options as a preselected or default option. The user can upload an image and add the item to the cart without ever selecting one of the options I have created. When this happens the syntax error appears.
    HOPEFULLY this is what is causing it.

    Can we get the option to have one of the options preselected? Or make the options be required? Or, not show the cropping window UNTIL an option is selected.

    Something similar to the image field where there is the “selected image” field where we can define one of the images to be pre selected.

    Hi @troypouliot,

    Ok, thanks for sharing it. Now have fixed this issue in version 21.2. And we also added the option for first option and Default selected ??

    It will be released soon.

    Thread Starter troypouliot

    (@troypouliot)

    How is this update coming? I really need to have this issue fixed. Have any suggestions for another image cropping tool to replace this?

    It will be released in a few days, but if you really need it you can ask our support via email to get the download link.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘files.php error’ is closed to new replies.