Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Dražen 1 year, 9 months ago.

Assisted by: Dražen.

Author Posts
April 3, 2023 at 1:05 pm #13390293

saschaN-5

I am trying to translate a post and all it's fields from German to English.

I expect to be able to save the translated post.

Instead I can not save the post, because an ACF repeater field with the translation setting "Copy" and the minimum row requirement produced the message "Minimum rows reached (1 rows)", and the site says "Validation failed. 1 field requires attention".

April 4, 2023 at 7:17 am #13396751

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons.

You can access the WordPress dashboard using the link below:
- hidden link

Kindly follow the steps below:
- Set up WPML
- Install the ACF
- Try to replicate the issue with a simple example and using only minimum plugins and the WP default theme
- Share with me step by step guide on how can I check the issue

This help speeds things up so we can check and confirm if this might be a WPML bug or an issue specific to your website/configuration.

Let me know.

Thanks,
Drazen

April 6, 2023 at 9:36 pm #13423295

saschaN-5

Dear Drazen,

Thank you very much for the test system.
I installed the plugins "Advanced Custom Fields Multilingual" and "Advanced Custom Fields PRO".
I set up WPML and created an ACF group with one repeater field and one text field. I set the Multilingual Setup to "Expert", since I didn't see the "Translation preferences" otherwise, and I needed to set this to "Copy", to see the problem.
I created a post and filled in the title and the new fields here:
hidden link
But even trying to save the repeater field does not work, the text in the first row disappears after saving, so I don't even get as far as translating the post. The normal ACF text field saves without a problem.

Thank you for your assistance!

April 7, 2023 at 6:05 am #13424979

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for getting back and taking the time to reproduce.

Can you please try now again? You forget to add the field name/title in ACF settings, so it probably caused the issue, seems to work fine.

Let me know if it goes and if able to reproduce.

Regards,
Drazen

April 7, 2023 at 7:25 am #13425239

saschaN-5

Thank you, I did overlook that. I also set the text field to translate: copy, and created a date field with translation setting copy (all inside the repeater field).

Next steps:
* I set the translation option to "Wordpress Editor"
* I duplicated the post to English
* I edited the English post with "Translate independently"
* Side note: The required-star shows up as plain HTML (Repeater Field <span class="acf-required">*</span>)
* The repeater field - fields are all there in the english translation, locked to there value.
* Trying to save the post results in the described error (Minimum rows reached (1 rows)).

April 7, 2023 at 9:12 am #13426045

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for getting back.

I was able to reproduce and confirm the issue.

This seems to happen with ACFML 2.0+ versions and only if both subfields are set to COPY. If you set the text subfield to TRANSLATE, it works fine.

* Side note: The required-star, seems to be fixed with the latest ACFML 2.0.4.

I will escalate this issue further to our 2nd tier to confirm and escalate to developers for a fix, I will update you as soon as I have some news.

In the meantime, you can use my suggestion to set the text subfield to TRANSLATE, as a workaround.

Kind regards,
Drazen

April 7, 2023 at 9:28 am #13426123

saschaN-5

Thank you for your reply. Unfortunately on our real application, all the fields are checkboxes and datepickers, so all fields need to be set to copy. I will test it with the translation mode "Same fields across languages" instead of "Expert", maybe that makes a difference.

April 7, 2023 at 9:31 am #13426141

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for getting back.

I understand, but as a workaround setting 1 field to Translate, I think should work and help, while we wait for an update or a better workaround.

Otherwise, you can downgrade to ACFML 1.10.4 if you prefer that.

https://wpml.org/download/acfml/?section=changelog

I will update as soon as I have more news.

Regards,
Drazen

April 7, 2023 at 10:06 am #13426403

saschaN-5

Ok, thank you.

April 11, 2023 at 6:24 am #13441947

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

our 2nd tier checked.

This is not a recommended setup though. Generally, when the translation is edited with the native WP editor, it's recommended to use copy-once in place of copy.
And this is what the "Different fields across languages" mode does.

I am sharing some more thoughts on this bellow, let me know if this helps and makes sense, or maybe we have misunderstood the usage case here and you sill need our help.

- If you are just duplicating a post you don't need to update the post in 2nd language
- if you are using native editor with a different layout then setting the field to copy-once instead of copy is more useful.
- If you want to keep same layout and translate some field and rest are set to copy then switching to ATE/CTE is recommended.

Workaround if you still want to get rid of this message without changing the any settings/workflow.

Add this to theme functions.php

add_filter('acf/validate_value', function ($valid, $value, $field) {
	if (isset($field['wpml_cf_preferences']) && $field['wpml_cf_preferences'] === WPML_COPY_CUSTOM_FIELD) {
		$elem = apply_filters('wpml_element_language_details', false, [
			'element_id' => $_REQUEST['post_ID'] ?? false,
			'element_type' => $_REQUEST['post_type'] ?? false
		]);

		if (isset($elem->source_language_code) && !empty($elem->source_language_code)) {
			return true;
		}
	}

	return $valid;
}, 99, 3);

Please let me know.

Thanks,
Drazen

April 14, 2023 at 8:57 am #13471939

saschaN-5

Dear Drazen,

Thank you for this workaround. We already downgraded the plugins and are using this setup right now. I will have time to test your workaround only in the upcoming weeks. Can you please keep this ticket open, I will report back as soon as I had a chance to test it.

Many thanks,
Margit

April 14, 2023 at 9:43 am #13472383

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello Margit,

sure, take your time.

Please also let me know your thought on this is not recommended setup and whether you should use as said those recommended translation settings for fields depending on your need.

Apart from these cases mentioned if there is any other case, please let us know so we can understand the practical problem.

Also if the workaround helps for your case is a valid solution for you.

Regards,
Drazen

April 17, 2023 at 10:24 am #13486533

saschaN-5

On this WP project, we are still unsing the classic editor, and not Guttenberg. We are in the process of updating to Guttenberg now, but for several reasons, we are using the plugins "Classic Editor" and "Classic Widget" right now. Also because of this, we are still using the old translation editor.
I will get back to you after testing the workaround. Thank your for your patience!

April 17, 2023 at 12:43 pm #13487809

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

sure, let us know.

Thanks,
Drazen

The topic ‘[Closed] ACF repeater with minimum row requirement produces error when translating a post’ is closed to new replies.