-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating a product always returns woocommerce_product_image_upload_error #56
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
that was a slut they did with the link of the images, because now contain "?" in the image link url does not work and this error. |
that was a slut they did with the link of the images, because now contain "?" in the image link url does not work and this error. [https://github.com/woocommerce/woocommerce/issues/24484](url my) |
@cdiguy please take a look at the reason why we made a change in regards to the type of URL allowed in woocommerce/woocommerce#24484. Thanks to @guilherme-oliveria for pointing it out. I am closing this issue since this is not a bug. |
I have a custom plugin that creates/updates product pages from information retrieved from an external customer database. The plugin uses the WooCommerce REST API PUT request to update existing product page data. When I updated WooCommerce from ver 3.4.4 to ver 3.7.0 I began to see the following error for all product page updates:
Code: 400
Headers: Array
(
[Date] => Thu, 31 Oct 2019 17:34:55 GMT
[Server] => Apache/2.2.15 (CentOS)
[X-Powered-By] => PHP/7.2.1
[Set-Cookie] => PHPSESSID=7uo0ufol9pnejka6ru0pvm7sov; path=/
[Expires] => Wed, 11 Jan 1984 05:00:00 GMT
[Cache-Control] => no-transform, no-cache, must-revalidate, max-age=0
[Pragma] => no-cache
[X-Robots-Tag] => noindex
[Link] => http://beta.cdielectronics.com/wp-json/; rel="https://api.w.org/"
[X-Content-Type-Options] => nosniff
[Access-Control-Expose-Headers] => X-WP-Total, X-WP-TotalPages
[Access-Control-Allow-Headers] => Authorization, Content-Type
[Allow] => GET, POST, PUT, PATCH, DELETE
[Content-Length] => 159
[Connection] => close
[Content-Type] => application/json; charset=UTF-8
)
Body: {"code":"woocommerce_product_image_upload_error","message":"Invalid image: Sorry, this file type is not permitted for security reasons.","data":{"status":400}}
Our debug output for one of the product updates:
[31-Oct-2019 17:34:55 UTC] [admin-ajax.php][192.168.1.183][][DEBUG] upsert_wc_product called for sku 113-4041
[31-Oct-2019 17:34:55 UTC] [admin-ajax.php][192.168.1.183][][DEBUG] wc_existing_product_id: 19624
[31-Oct-2019 17:34:55 UTC] [admin-ajax.php][192.168.1.183][][DEBUG] get_post_thumbnail_id: no media attached to product ID = 19624
[31-Oct-2019 17:34:55 UTC] [admin-ajax.php][192.168.1.183][][DEBUG] Updating existing product: Data: Array
(
[sku] => 113-4041
[name] => Power Pack 4 Cyl.
[slug] => 113-4041
[type] => simple
[description] => 1988-2001 (120,125,130,135 & 140HP) Loop Charged Engines w/ Quick Start & S.L.O.W., 6700 RPM Limit
Replaces:
113-4041, 18-5772, 583489, 584040, 584041, 9-25017[upsell_ids] => Array
(
[0] => 19427
)
)
[31-Oct-2019 17:34:56 UTC] [admin-ajax.php][192.168.1.183][] Error: Invalid image: Sorry, this file type is not permitted for security reasons. [woocommerce_product_image_upload_error]
There are over 900 product pages we are attempting to update. This error is returned for every product page image file. I have verified that the image files exist.
Up through WooCommerce version 3.5.1 I do not get this error. I see the error for versions 3.6.5, 3.7.0, 3.7.1. I have not tested versions between 3.5.1 and 3.6.5 to see in which version the error starts appearing. I am assuming the error exists in all versions since at least 3.6.5.
The text was updated successfully, but these errors were encountered: