Skip to content Skip to sidebar

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.

This topic contains 39 replies, has 1 voice.

Last updated by walter-arielM 1 day, 19 hours ago.

Assisted by: Paweł Halicki.

Author Posts
March 19, 2026 at 10:29 am #17910502

Paweł Halicki
Supporter

Hello,
it looks like the issue concerns products that were not created in the default language and then translated from it. Currently, the default language is "Spanish (default)" - has it been changed recently?

I will try to prepare an SQL query to detect problematic cases, and then another one to fix them.

If you have come across any products that have this issue, they would be useful to verify whether they are detected by the fixing script.

March 19, 2026 at 10:31 am #17910505

Paweł Halicki
Supporter

Hello,

In the meantime, I would also ask for confirmation whether this one case has actually been fixed.

Best regards,
Pawel

March 19, 2026 at 10:48 am #17910639

walter-arielM

Hello,

I think the default language was 'catalan', not 'spanish'. Is it possible that it changed on its own after an update? Could setting 'Catalan' back to default fix this issue?

I will try the fix for the single one and let you know.

March 19, 2026 at 11:22 am #17910790

walter-arielM

Hello,

Confirmed: the SQL code works fine. It fixes the issue completely.

March 19, 2026 at 2:18 pm #17911415

Paweł Halicki
Supporter

Hello,

I wouldn't modify the default language until we fix the current state - it would just cause more confusion. I checked the database dump and it seems easier to fix the current state, since there are simply fewer records.

Thank you for confirming that the fix worked for that one record.
I will try to prepare SQL to fix the remaining ones by tomorrow. Since this modifies many records, I need some time to verify that the edit went through correctly:

* I need to check the initial state of the database
* Execute the SQL
* Verify that everything has been fixed - if not, I need to restore it and improve SQL

Best regards

March 20, 2026 at 8:22 am #17912883

walter-arielM

Hello,

Ok. I will await your response.

Regards

March 23, 2026 at 11:32 am #17918361

Paweł Halicki
Supporter

Hello,

I have prepared an SQL query that identifies potentially affected products (it does not modify any data). I reviewed the IDs by editing different language versions, and in all cases, the relationships remained correct.

I’m sharing the SQL below:

SELECT
    *
FROM
    (
    SELECT
        p2.ID,
        p2.post_type,
        (
        SELECT
            COUNT(*)
        FROM
            `wp_icl_translations` t1
        LEFT JOIN `wp_icl_translations` t2 ON
            t1.trid = t2.trid
        WHERE
            t1.element_id = p2.ID
    ) AS ctr,
    t.*
FROM
    `wp_icl_translations` t
LEFT JOIN `wp_posts` p ON
    p.ID = t.element_id
LEFT JOIN `wp_posts` p2 ON
    p2.ID = p.post_parent
WHERE
    element_type = 'post_product_variation' AND language_code = 'ca' AND source_language_code IS NULL
) AS sub
WHERE
    sub.ctr >= 3
ORDER BY
    element_id;

Could you please confirm whether you have encountered any problematic cases other than the one already reported?

Best regards, and I look forward to your feedback.

March 23, 2026 at 6:06 pm #17919767

walter-arielM

Hello,

Should I run this code and get back to you with the results?
Please, let me know.

Regards,

March 23, 2026 at 6:23 pm #17919789

walter-arielM

Hello again,

I'm not sure I understand correctly.

Does this code solve the problem, or should I run this code and come back here to paste the results?

Please, let me know.

Regards,

March 23, 2026 at 7:38 pm #17919860

Paweł Halicki
Supporter

Hello,

Thank you for your quick response. To clarify further:

- The SQL I provided should generate a list of items that, when edited, could potentially “detach” from their other translations.
- I reviewed this list on my copy by editing the items in different languages, and the translation connections remained intact.

Next steps:

- If possible, please generate the SQL report and:
- share it in a private message,
- edit and verify whether the translation connections remain intact for these objects (there shouldn’t be many; if any show an issue, please provide the ID and I will prepare a fix).
- For verification purposes: have you encountered any other products where editing caused the translations to disconnect?

Best regards, and I look forward to your feedback.

March 25, 2026 at 6:58 am #17924553

walter-arielM

Hello,

I understand. I will get back to you with information.

Thanks.

March 25, 2026 at 7:02 am #17924575

walter-arielM

Hello,

Results here: hidden link

Please, let me know.

Regards,

March 26, 2026 at 10:50 am #17928643

Paweł Halicki
Supporter

Hello,

Thank you for sharing the results - I will restore the backup today and check whether there are any issues with these products.

I can see that the limit is set to 25 results per page, and there are 22 results in total, so I assume there are no additional pages.

Best regards,
Pawel

April 1, 2026 at 10:27 am #17942568

Paweł Halicki
Supporter

Hello,

I restored the backup and, as part of the standard process, updated the plugins.

Then:
- visited each record by inserting the ID into the URL `post.php?post=22752&action=edit`,
- checked each item on the frontend,
- edited the product in each language to verify that the relationships between translations remained intact on the frontend.

Raport:

- OK: 22752 - ce, es, en - Anonymous white jewelry label
- OK: 22757 - ce, es, en - 250 Etiquetas joyería blanca anónima
- OK: 22973 - ce, es, en - Industrial label "1€"
- OK: 22976 - ce, es, en - 500 Etiquetas Industriales "1€
- OK: 23322 - ce, es, en - Cardboard heart label
- OK: 23327 - ce, es, en - 50 Etiquetas cartulina corazón
- OK: 42457 - ca, en -  Etiqueta Sant Valentí "T'estimo" dibuix cors

I did not find any problematic cases - in all instances, the products were edited correctly and the connections between languages were preserved.

If you have not encountered any problematic cases on your side, I would consider the issue resolved.

I look forward to your feedback.
Best regards,
Pawel

April 4, 2026 at 5:37 pm #17949406

walter-arielM

Hello,

I am not sure if I understand you. Did you run the snippet and fixed the problem?

Please, let me know.