Home › Forums › WoodMart support forum › Translation of Woodmart Layouts gets stuck after saving the translation
Translation of Woodmart Layouts gets stuck after saving the translation
- This topic has 22 replies, 3 voices, and was last updated 1 year, 5 months ago by Artem Temos.
-
AuthorPosts
-
July 3, 2023 at 6:16 pm #478939
VialParticipantHello,
since the last Woodmart update I have the problem that my translation of the layouts via WPML always hangs and is marked as “not finished”.
I can create a translation without any problems and translate all elements, but after the “Save” button the icon circles around.
Since I work on a multisite, I have created a test page and deactivated all those that are not necessary. The translation problem did not change.
Only when I changed the theme from Woodmart to Storefront could the layouts be translated.
I have done all the tips from WPML support, but that has not fixed the problem.
In the debug.log I only find the following messages:
[03-Jul-2023 14:09:21 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_gallery_image_ids() on null in /wp-content/themes/woodmart/woocommerce/single-product/product-image.php:27
Stack trace:
#0 /wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include()
#1 /wp-content/themes/woodmart/inc/modules/layouts/elementor/single-product/class-gallery.php(199): wc_get_template(‘single-product/…’, Array)
#2 /wp-content/plugins/elementor/includes/base/controls-stack.php(2268): XTS\Modules\Layouts\Gallery->render()
#3 /wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#4 /wp-content/plugins/elementor/includes/base/widget-base.php(673): Elementor\Widget_Base->render_content()
#5 /wp-content/plugins/elementor/includes/db.php(202): Elementor\Widget_Base->render_plain_content()
#6 /wp-content/plugins/element in /home/www/mul-novotec/wp-content/themes/woodmart/woocommerce/single-product/product-image.php on line 27
But under WooCommerce > Status > Logs I don’t get a fatal error.
The site is still under development, but this bug is slowing down the development progress a bit.
Do you have any idea what the problem could be?
I would be very grateful for your help.Kind regards,
JanineAttachments:
You must be logged in to view attached files.July 4, 2023 at 10:56 am #479028
Luke NielsenKeymasterHello,
Define the product in the “Select preview product for builder” field from Theme Settings -> Single product and then recheck the issue.
Let me know the result.
Kind Regards
July 4, 2023 at 11:41 am #479038
VialParticipantHello Luke,
I set a product for the preview, cleaned everything in WPML, but the same thing happens. It is not possible to save my translation as the loading icon keeps spinning. If I use WPML’s advanced translation editor, I can save my translation, but the status stays “in progress”.
Kind regards
JanineAttachments:
You must be logged in to view attached files.July 4, 2023 at 12:12 pm #479045
Luke NielsenKeymasterHello,
We checked and there are no new errors in the logs, so the problem you encountered is most likely solved, we also tested the translation with regular pages and it works the same as with our layouts.
I’d be happy to assist if you have any other questions or concerns.
Kind Regards
July 5, 2023 at 10:23 am #479283
VialParticipantHello Luke,
the error message has indeed disappeared.
Thank you!Kind regards
July 5, 2023 at 10:35 am #479288
VialParticipantHello Luke,
I have now a new error in my debug.log:
PHP Notice: Trying to get property ‘ID’ of non-object in wp-content/themes/woodmart/inc/integrations/woocommerce/modules/class-adjacent-products.php on line 87
[05-Jul-2023 07:30:29 UTC] PHP Notice: Trying to get property ‘ID’ of non-object in /wp-content/themes/woodmart/inc/integrations/woocommerce/modules/class-adjacent-products.php on line 168July 5, 2023 at 2:49 pm #479361
Artem TemosKeymasterCould you please provide us access to your log file in real time so we can check this?
July 5, 2023 at 3:21 pm #479376
VialParticipantYes, of course.
Here are the credentials for the ftp access.July 6, 2023 at 2:49 pm #479658
Artem TemosKeymasterWe don’t see the error now. Probably, it appeared once in the past but we can’t reproduce it.
July 7, 2023 at 3:40 pm #479924
VialParticipantAlright, that’s good.
Thank you for your help!July 7, 2023 at 5:23 pm #479967
Artem TemosKeymasterOK, fine. Let us know if you have any further questions.
July 12, 2023 at 2:40 pm #480890
VialParticipantHi Artem,
I asked WPML support because the translation of Woodmart layouts is still not finished. The status is always on “In progress”. After investigating the site, they found that there is no error message from WPML in the error log, only a specific Fatal error from Woodmart theme.
Even after disabling WPML, the error appears which prevents saving layout changes, so it’s something Woodmart related.
This is an excerpt from the debug.log.
Although all subsites now have a product assigned under “Select preview product for builder”, the error does not go away.[12-Jul-2023 11:22:21 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_gallery_image_ids() on null in /wp-content/themes/woodmart/woocommerce/single-product/product-image.php:27
Stack trace:
#0 /wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include()
#1 /wp-content/themes/woodmart/inc/modules/layouts/elementor/single-product/class-gallery.php(199): wc_get_template(‘single-product/…’, Array)
#2 /wp-content/plugins/elementor/includes/base/controls-stack.php(2268): XTS\Modules\Layouts\Gallery->render()
#3 /wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#4 /wp-content/plugins/elementor/includes/base/widget-base.php(673): Elementor\Widget_Base->render_content()
#5 /wp-content/plugins/elementor/includes/db.php(202): Elementor\Widget_Base->render_plain_content()
#6 /wp-content/plugins/element in /wp-content/themes/woodmart/woocommerce/single-product/product-image.php on line 27I need help here urgently, as WPML is extremely important for the website and we can’t really continue working like this. I need the possibility to translate the layouts and that these then also appear in the frontend.
So far, only the translation works, only save and display, fails.Best Regards,
July 12, 2023 at 4:44 pm #480917
Artem TemosKeymasterHello,
Could you please clarify when exactly you see the error? What actions should we perform to make this error appear in the log?
Kind Regards
July 12, 2023 at 5:37 pm #480940
VialParticipantHi Artem,
To reproduce the error I did the following:
– Switch to Layouts on my test page (testtraining. ….).
– There open e.g. the layout “Produktseite – Normales Produkt” in Elementor (product page – default product).
– Make a small change to the layout, e.g. change a heading.
– Exit Elementor and update the layout via WPML.
– Perform update in advanced translation editor & click on “Finish”.
– In the frontend I see my layout in my original language and in the second language .
Problem 1: The update icon keeps circling and does not change to the “pen” icon.
Problem 2: If I now change something in my layout again, the layout can no longer be updated, because I can’t click on the icon at all.
Only after deleting the jobs via WPML > Translation Management > Jobs I can update the layout.
In the debug.log I then see several error messages with the same content within a few miliseconds.
July 13, 2023 at 5:41 pm #481297
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file to fix this
add_action( 'init', function () { if ( did_action( 'elementor/loaded' ) && wp_is_json_request() ) { remove_action( 'elementor/widgets/register', array( XTS\Modules\Layouts\Main::get_instance(), 'register_layout_widgets' ) ); } });
July 14, 2023 at 10:07 am #481443
VialParticipantI have now activated the child theme on the test page and entered the code.
Both problems unfortunately remain and this also shows in the debug.log which gets bigger and bigger.
July 14, 2023 at 11:26 am #481473
Artem TemosKeymasterOK, try to replace that one with this code
add_action( 'woocommerce_before_template_part', function () { global $product; if ( wp_is_json_request() && ! $product ) { $random_product = new WP_Query( array( 'posts_per_page' => '1', 'post_type' => 'product', ) ); while ( $random_product->have_posts() ) { $random_product->the_post(); $product_id = get_the_ID(); } wp_reset_postdata(); $product = wc_get_product( $product_id) ; } } );
July 14, 2023 at 12:58 pm #481501
VialParticipantThanks for the new code.
The translation now completes successfully. That’s great!
But now I have discovered another problem.
In the frontend I see my custom layout, but in the translated language it is not shown anymore.If I check the conditions in English I see that the translated category is not used, but the German one (original language). If I change the category manually to English, the translated layout is displayed in the frontend. BUT if I make a new change to the layout in the original language and update the translation, the category is wrong again.
The categories are all translated and the meta fields are set to “Copy” which normally works without problems.
July 14, 2023 at 3:54 pm #481554
Artem TemosKeymasterСould you provide a video demonstrating this issue so that we can better understand the problem in more detail?
July 14, 2023 at 5:29 pm #481571
VialParticipantOf course! Here it is.
July 17, 2023 at 11:48 am #481971
Artem TemosKeymasterYou need to set this field to “Translate” instead of “Copy” https://monosnap.com/file/68EgHrHYWLuKvvukfW4Jmvyt2CYwT7
And then set the translated category ID during the translation.Kind Regards
July 17, 2023 at 3:12 pm #482072
VialParticipantThe custom field is now set to “Translate”.
However, during translation I cannot select an ID or the product category name.
Attachments:
You must be logged in to view attached files.July 17, 2023 at 4:43 pm #482100
Artem TemosKeymasterWe understand that the issue you are experiencing is likely related to the WPML due to an incorrect translation of a custom field. The field in question, which needs to be translated, contains an array with 3 keys (https://monosnap.com/file/uqqpswxPOohXVwrFWp96VtMKpVyzK6), while WPML is displaying only an array with 2 keys (https://monosnap.com/file/n4mKFi8qd0IrKL3cbyLd9FZtpmd0r1). Therefore, could you please contact the technical support of WPML to resolve this issue?
-
AuthorPosts
- You must be logged in to create new topics. Login / Register