Closed mattwatsoncodes closed 2 years ago
We are getting an issue when creating a Variable Product with WooCommerce and then attempting to translate that error via MultilingualPress.
Steps to recreate:
Product
Product data
Variable product
Attribute 1
1 | 2
Translation for...
Create a new Product, and use it as translation in...
Fatal error: Uncaught Error: Return value of AssetManagerFramework\replace_attached_file() must be of the type string, bool returned in /usr/src/app/vendor/humanmade/asset-manager-framework/inc/namespace.php on line 217 Call stack: AssetManagerFramework\replace_attached_file() wp-includes/class-wp-hook.php:307 WP_Hook::apply_filters() wp-includes/plugin.php:189 apply_filters() wp-includes/post.php:744 get_attached_file() content/plugins/multilingualpress/src/modules/WooCommerce/TranslationUi/Product/MetaboxAction.php:1064 Inpsyde\M\M\W\T\P\MetaboxAction::getSourceProductVariationAttachmentData() content/plugins/multilingualpress/src/modules/WooCommerce/TranslationUi/Product/MetaboxAction.php:172 Inpsyde\M\M\W\T\P\MetaboxAction::doSaveOperation() content/plugins/multilingualpress/src/modules/WooCommerce/TranslationUi/Product/MetaboxAction.php:131 Inpsyde\M\M\W\T\P\MetaboxAction::save() content/plugins/multilingualpress/src/modules/WooCommerce/ProductMetaboxesBehaviorActivator.php:140 Inpsyde\M\M\W\ProductMetaboxesBehaviorActivator::saveMetaboxes() wp-includes/class-wp-hook.php:309 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:474 do_action() content/plugins/multilingualpress/src/multilingualpress/TranslationUi/Post/MetaboxAction.php:470 Inpsyde\M\T\P\MetaboxAction::savePost() content/plugins/multilingualpress/src/multilingualpress/TranslationUi/Post/MetaboxAction.php:279 Inpsyde\M\T\P\MetaboxAction::doSaveOperation() content/plugins/multilingualpress/src/multilingualpress/TranslationUi/Post/MetaboxAction.php:114 Inpsyde\M\T\P\MetaboxAction::save() content/plugins/multilingualpress/src/framework/Admin/Metabox/MetaboxUpdater.php:127 Inpsyde\M\F\A\M\MetaboxUpdater::saveMetabox() content/plugins/multilingualpress/src/framework/Admin/Metabox/Metaboxes.php:455 Inpsyde\M\F\A\M\Metaboxes::saveMetaBoxes() content/plugins/multilingualpress/src/framework/Admin/Metabox/Metaboxes.php:420 Inpsyde\M\F\A\M\Metaboxes::onPostSave() content/plugins/multilingualpress/src/framework/Admin/Metabox/Metaboxes.php:245 Inpsyde\M\F\A\M\Metaboxes::Inpsyde\M\F\A\M\{closure}() wp-includes/class-wp-hook.php:309 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:474 do_action() wp-includes/post.php:4698 wp_insert_post() wp-includes/post.php:4789 wp_update_post() wp-admin/includes/post.php:426 edit_post() wp-admin/post.php:227
Mitigation
If you override the default image that is added to each product variation, and attempt to translate the product again, the above error does not occur.
This should be fixed by updating the Altis media module using composer update altis/media -W.
composer update altis/media -W
Fix is in release 0.13.2
We are getting an issue when creating a Variable Product with WooCommerce and then attempting to translate that error via MultilingualPress.
Steps to recreate:
Product
post type is translatableProduct data
meta box, set the project type toVariable product
Attribute 1
with the values1 | 2
, be sure to save the attributes when you have finishedTranslation for...
that relates to the other site on your networkCreate a new Product, and use it as translation in...
radio buttonMitigation
If you override the default image that is added to each product variation, and attempt to translate the product again, the above error does not occur.