Skip Navigation

[Gelöst] CPT on create/update the _views_template is set to instead to the correct templa

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
The user was losing the content template for posts on each post update.

Solution:
It turns out that this happens because of WPML. The content template does not have language information attached, which blocks them from being queried by Toolset. When saving a post, there is simply no content template to use.

The solution is to assign language information by running "Set language information" in WPML->Support->Troubleshooting, after a database backup.

Relevant Documentation:
https://wpml.org/documentation/support/wpml-troubleshooting-options/

This support ticket is created vor 2 Jahre, 11 Monate. There's a good chance that you are reading advice that it now obsolete.

Dies ist das technische Support-Forum für Toolset – eine Suite von Plugins zur Entwicklung von WordPress-Websites ohne PHP-Pogrammierung.

Jeder kann in diesem Forum lesen, aber nur Toolset-Kunden können darin Beiträge veröffentlichen. Der Toolset-Support arbeitet 6 Tage pro Woche, 19 Stunden pro Tag.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by rainerW vor 2 Jahre, 11 Monate.

Assigned support staff: Jamal.

Author
Artikel
#1685217

Ich versuche:
I do have a CPT (koepfe) which has a Inhalts-Template but if i enter a new Koepfe or update an existing one, the meta_value of _views_template is set to 0.

URL der/meiner Website, auf der das Problem auftritt:
hidden link

Erwartet hatte ich zu sehen:
that _views_template value remains to be the corrrect value 12403 .

Stattdessen bekam ich:
_views_template value set to 0

I can find the wrong set _views_template with this sql
SELECT A.ID,A.post_title,B.meta_key,B.meta_value FROM hcrposts A, hcrpostmeta B WHERE A.post_type='kopf' AND A.ID=B.post_id AND B.meta_key='_views_template' AND B.meta_value!='12403'

and fix it also with
UPDATE hcrposts A, hcrpostmeta B SET B.meta_value='12403' WHERE A.post_type='kopf' AND A.ID=B.post_id AND B.meta_key='_views_template' AND B.meta_value!='12403'

But i think this is should not be necessary, please can check this behaviour and depoly a patch.

The Template View
hidden link

#1685457

Jamal
Supporter

Languages: Englisch (English ) Französisch (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

I suspect that this issue is provoked by something else, please check if it appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty Fourteen. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at the time to track where the incompatibility is produced.

If it does not, please share a copy of your website and let me investigate this locally. Or allow me to take it my self.
https://toolset.com/faq/provide-supporters-copy-site/

Please use filter to reduce the size of the copy as described in this video around 1:00 hidden link
If Duplicator fails to create a copy, we'll need a database copy/export, plugins, and theme folders, all in a zip file.
Your next reply will be private to let you share the download link safely.

#1686715
#1686787

Jamal
Supporter

Languages: Englisch (English ) Französisch (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for your feedback. I might have found the issue but I was not able to confirm the solution as all posts from the custom post type is returning 404 in the frontend. That might be caused by something else, we can debug it later as it seems to work in the production site.
- This is working: hidden link
- This is not working: hidden link

I think that the issue came from the fact that no content templates are recognized by Toolset. Check this screenshot hidden link
It seems that the content templates do not have language information attached, and WPML can't recognize what language for each content template.

After running the "Set language information" action in WPML->Support->Troubleshooting, the issue seems to be resolved. Updating any post does not lose the content template. Check this screenshot hidden link

Note that WPML asks for a backup before running this action. Please take a backup of your production site before running this action.

I hope this helps. Let me know what you will get.

#1686797

My issue is resolved now. Thank you!

Das Forum „Toolset Professioneller Support“ ist für neue Themen und Antworten geschlossen.