Templates visibility conditions disappear when switching language using WPML from Cwicly Themer page

Description:
The visibility conditions set for a template are removed when switching language using the language dropdown from the top bar. So far we observed this issue only on the Themer page.

When viewing the Themer page (initial page load) or updating the visibility conditions for any template, the visibility conditions for all the templates are sent from the frontend to this endpoint: /wp-json/cwicly/v1/options?_locale=user. When the language is switched, only the templates that are translated are listed. So if I haven’t translated a template, it’s not listed and the request to the backend does not have the previously set conditions for the original template. So every time I switch languages for other pages, come back to the Themer page, since the templates are not translated yet, I lose all visibility conditions for the templates.

Step-by-step reproduction instructions:

  1. Go to WP Admin.
  2. Install and activate the plugins ACF, Cwicly, WPML, WPML String Translation
  3. When setting up WPML, make sure you select the ‘Translate What You Choose’ option for Translation Mode.
  4. Install and activate Cwicly theme
  5. Create a new post type
  6. Create a test post with the new post type
  7. Create a template using Cwicly for this new post type and set the visibility conditions.
  8. Go to the Themer page and switch language using the language dropdown from the top admin bar. Note: The newly created template will not be listed here as it is not yet translated.
  9. Switch back to the original language.
  10. The visibility condition for the template will be removed now.

Environment info

WordPress version: 6.2.2
Cwicly Plugin version: 1.3.2.1
WPML version: 4.6.5
WPML String Translation version: 3.2.7
PHP version: 8.1

Was anyone able to replicate this issue?

Hi @nived,

Apologies for the delayed response.

As mentioned by email, our team will be investigating this further in the next few days.
We appreciate your patience in the meantime.

Thank you for your understanding.

Hello @nived,

Thanks for your patience on this one.
This should be addressed in 1.3.4.2.

I’d be grateful if you could let me know if this fixes the issue for you.

Cheers,