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

Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #478939

    Vial
    Participant

    Hello,

    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,
    Janine

    Attachments:
    You must be logged in to view attached files.
    #479028

    Luke Nielsen
    Keymaster

    Hello,

    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

    #479038

    Vial
    Participant

    Hello 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
    Janine

    Attachments:
    You must be logged in to view attached files.
    #479045

    Luke Nielsen
    Keymaster

    Hello,

    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

    #479283

    Vial
    Participant

    Hello Luke,

    the error message has indeed disappeared.
    Thank you!

    Kind regards

    #479288

    Vial
    Participant

    Hello 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 168

    #479361

    Artem Temos
    Keymaster

    Could you please provide us access to your log file in real time so we can check this?

    #479376

    Vial
    Participant

    Yes, of course.
    Here are the credentials for the ftp access.

    #479658

    Artem Temos
    Keymaster

    We don’t see the error now. Probably, it appeared once in the past but we can’t reproduce it.

    #479924

    Vial
    Participant

    Alright, that’s good.
    Thank you for your help!

    #479967

    Artem Temos
    Keymaster

    OK, fine. Let us know if you have any further questions.

    #480890

    Vial
    Participant

    Hi 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 27

    I 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,

    #480917

    Artem Temos
    Keymaster

    Hello,

    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

    #480940

    Vial
    Participant

    Hi 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.

    #481297

    Artem Temos
    Keymaster

    Try 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' ) );
    	}
    });
    #481443

    Vial
    Participant

    I 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.

    #481473

    Artem Temos
    Keymaster

    OK, 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) ;
    	}
    } );
    #481501

    Vial
    Participant

    Thanks 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.

    #481554

    Artem Temos
    Keymaster

    Сould you provide a video demonstrating this issue so that we can better understand the problem in more detail?

    #481571

    Vial
    Participant

    Of course! Here it is.

    #481971

    Artem Temos
    Keymaster

    You 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

    #482072

    Vial
    Participant

    The 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.
    #482100

    Artem Temos
    Keymaster

    We 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?

Tagged: ,

Viewing 23 posts - 1 through 23 (of 23 total)