Salta la navigazione

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Nessun supporter è disponibile a lavorare oggi sul forum Italian. Sentitevi liberi di creare ticket e li gestiremo il prima possibile quando saremo online. Grazie per la comprensione.

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

Fuso orario del fornitore: Europe/Madrid (GMT+02:00)

Etichettato: 

Questo ticket contiene 18 risposte, ha 2 voci.

Ultimo aggiornamento da Andreas W. 1 anno, 2 mesi fa.

Assistito da: Paola Mendiburu.

Autore Messaggi
Febbraio 7, 2023 a 4:52 pm #12981227

christianc-8

When I try to add a new post or page, this error appears in console:

[site_url]/?p=xxx&_wp-find-template=true 404 (Not Found)

I'm using the latest WP and WPML releases. I checked out that it has to do with WPML Multilingual CMS: only if disabled, the error gets fixed. In fact changing theme or disabling other plugins have no effect on it.

Is this anything known or something weird that happens only to me?
Thanks.

Febbraio 7, 2023 a 10:28 pm #12982561

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

According to the provided debug information your site is running on localhost:

link nascosto

Is this correct?

Further, please try changing the site's URL format at WPML > Languages > Language URL Format.

Set it to "Languages in directories" and save then save the WordPress permalink setting.

Guide:
https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/#:~:text=WPML%20lets%20you%20choose%20to,to%20be%20in%20different%20sites.

If this will not solve the issue, I can offer to provide you with a test site with WPML on which we can try to recreate the issue from scratch with your theme and plugins.

Best regards
Andreas

Febbraio 8, 2023 a 8:55 am #12984851

christianc-8

Hi,
thank you for your support.

Yes the site is under construction locally and that's the current URL.
I checked your suggestion but the language settings is already saved with directory option activated, so nothing has changed as far as the 404 error is concerned.

If needed I could upload online a copy of the site so you can have full access ot it. Or tell me if there's something else I could try to fix it.

Regards.

Febbraio 8, 2023 a 7:24 pm #12991469

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

Does this issue remain when testing the site only with WPML and the Twenty Twenty One Theme?

a) If not you would need to run tests in a minimal setup and maybe run a WP Debug.

1) Disable any additional plugin that is not related to WPML and its add-ons.

2) If the issue disappears please start reactivating the plugins one by one, or activate them in small groups. This way please verify at which points the issue appears again to indicate the plugin that is causing the issue.

3) Also, if this did not clarify the cause of the issue please change to a default theme like TwentySeventeen to see if the issue might be theme related, if possible.

Further, you could enable the wp-debug feature to see if there are any current PHP errors given.

Add the following to your wp-config.php file:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

b) If yes, you could create a site copy with the free plugin "All In One WP Migration" and upload it to a service of your choice, like "We Transfer" for example, and then send me a download link - but please take note that this only should be the case if the issue remains when running the site only with WPML and the Twenty Twenty One Theme.

I have enabled the private reply form for this information.

The private reply form looks like this:
link nascosto

The steps are also shown in this video: link nascosto

Best regards
Andreas

Febbraio 9, 2023 a 8:37 am #12995235

christianc-8

Ok, thanks.
I checked it out and I found that the error disappear with Twenty Twenty One Theme but it remains with all other themes, including not only my custom theme but also Twenty Twenty Three and Twenty Twenty Two themes i.e. and it's strickly connected width WPML.

Best regards.

Febbraio 9, 2023 a 9:26 am #12995759

christianc-8

Ok I found the issue. The problem is the theme.json file. There is a sort of incompatibility between WPML and all themes using a theme.json file. If I delete it there's no error no matter what theme is active. In fact Twenty Twenty One does not use theme.json file. This is an utter problem, because nowadays editing theme.json is a good way to customize WP blocks.

Febbraio 9, 2023 a 2:50 pm #12999905

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

The file theme.json is usually supposed to be used on the new Block Themes, like Twenty Twenty-Three and others - it will work on Classic Themes but it will also disable some of its classic theme functions.

https://developer.wordpress.org/themes/advanced-topics/theme-json/#a-theme-json-can-be-added-to-any-theme

Further, it will not work on Classic themes, if they use the Classic Editor, as you need Gutenberg to run theme.json.

https://developer.wordpress.org/themes/block-themes/#differences-and-similarities-between-classic-themes-and-block-themes

Could you please try to recreate this issue on the following test site?

link nascosto

Please leave me a short message on this ticket when you are done.

Best regards
Andreas

Febbraio 9, 2023 a 4:27 pm #13000895

christianc-8

Hello,
here I am. I've activated Twenty Twenty Three theme and saved usual settings on WPML with two active languages, and you can check the same error in console now.

Immagine 2023-02-09 172626.png
Febbraio 9, 2023 a 7:38 pm #13002543

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

I see this 404 error, but is there actually any functional issue with setting up posts, templates, or their translations?

This error seems to be referring to the template translation "website template" not existing yet.

Take note, that WordPress Templates need to be translated at WPML > Translation Management.

Once the website template is translated, I do not longer see this error.

Guide:
https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/

Best regards
Andreas

Febbraio 10, 2023 a 9:12 am #13005241

christianc-8

Hi,
honestly I can't understand what you are talking about, I mean: I've never used Full Site Editing so there are no templates saved in my theme nor in your test site. I use blocks only for page/post content, not in full site editing mode.

The error refers to theme.json that define some rules for single blocks editing. Could you kindly let me se any example on your test site, please? because I continue to see the error there.

By the way, the error seems to have no functional effect on the site administration, but it's annoying anyway.

Thanks.

Febbraio 10, 2023 a 9:15 am #13005273

christianc-8

For now I fix it by deleting the theme.json file and applying similar rules by filters or similar. But this is not the best solution...

Febbraio 10, 2023 a 5:43 pm #13009051

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

The theme.json file controles themes for full site editing and enabled the theme editor - it further controles Block templates, which work completley different than Classic Theme templates.

https://developer.wordpress.org/themes/block-themes/templates-and-template-parts/

If you want to use the theme.json in Classic Themes, then maybe you need to adapt it in order not to support WordPress Block templates, but this is somehow out of scope for our support, as this is custom work and not WPML related.

The test site was using Twenty Twenty Three and yesterday after translating the "website" template, I did not longer see this error on my post editor screen. (See screenshot)

It is only a 404 about that a template can not be found and after the website tempalte was created the error was gone.

Full documentation:
https://developer.wordpress.org/themes/block-themes/

Best regards
Andreas

test.png
Febbraio 11, 2023 a 4:29 pm #13012715

christianc-8

Hi, thanks again for your reply.
I understand now what you said. But: theme.json should work - if desired - for ANY theme ('classic' of 'fse') featuring default Gutenberg blocks ( see link nascosto). For example: why shouldn't I add theme.json file to Twenty Twenty One child theme in order to control and customize some block editing panels? Typography, colors... etc...

This is what I did and what I need. I don't need extra features like Full Site Editing, I don't need to create website templates and translate them just to prevent WPML from displaying an error.

So: if WPML is fully compatible with WP I expect I can edit and use theme.json file in my theme anyhow.

Regards.

Febbraio 11, 2023 a 10:47 pm #13013197

Andreas W.
Supporter

Lingue: Inglese (English ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

I have tested this again on a new sandbox with Twenty Twenty Three now, and here I get on an original post this on the console when WPML Multilingual CMS is enabled:

Failed to load resource: the server responded with a status of 400 (Bad Request)

Once I complete the WPML Setup Wizard the error is gone. The error that you are reporting I can not see here at this moment.

Then I followed this tutorial and enabled Twenty Twenty One:
link nascosto

Going back to my post, I do not see any error on the console.

Now, could you please try to recreate the issue again here:

One-Click-Login:
link nascosto

Further, in order to escalate this issue, I do need to see the theme.json file that you are using - I would appreciate you use Twenty Twenty One for this test.

We do not have FTP access for this sandbox, but you can use File Manager.

Please also document any changes that you made to the theme and send them to me in a shortlist.

Best regards
Andreas

Febbraio 13, 2023 a 8:11 am #13017659

christianc-8

Hi,
it is easy to say: without making any change on your Twenty Twenty One based test site, I can reproduce exactly the same old 404 error, just add a new post/page. See screenshot attachment.

Further info: I've browsed it with Chrome 109.0.5414.121 64-bit but I tested it also with Firefox 109.0.1 (64 bit).

As I said before, it does not depend on the type of theme.json, it is related to the presence of that file in itself, no matter what theme is active or what settings you have written in it.

Regards.

Immagine 2023-02-13 085207.png