Skip Navigation

[Fermé] Toolset association entry delete after database upgrade

This support ticket is created Il y a 4 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 4 années et 1 mois.

Auteur
Publications
#1805569

Hi Support Team,

My website is made using Toolset types, Toolset Views, Toolset Forms, Toolset Access this all plugins and my website address is

lien caché

In my website there are below all post types

Classroom
Course
Lesson
Chapter

Above all post type are in Relationship like below

Classrooms (One) => Course (Many)
Course (One) => Lesson (Many)
Lesson (One) => Chapter (Many)

In my website above all are show in backend using custom code in classroom post backend i show list of all related course same as in side course i show list of lesson and in lesson post i show list of all chapter which are in relationship using metabox and that are show by custom query fetch from wp_toolset_associations table it working fine till yesterday but i show one notice in my dashboard

"Toolset want to Upgrade Database"

After upgrade database all the relationship of my classroom,course,lesson, and chapter are deleted from wp_toolset_associations. table can you please tell me why this happened i am pasting my custom query below.

global $wpdb;
$courseid = $post->ID;
$table_name = $wpdb->prefix . "toolset_associations";

$lessonids = $wpdb->get_results("SELECT $table_name.*,wp_toolset_relationships.slug FROM $table_name,wp_toolset_relationships where $table_name.parent_id = " . $courseid . " and wp_toolset_relationships.is_active = 1 and wp_toolset_relationships.id = $table_name.relationship_id");

Above query i write in my metabox code for find list of all related lesson from course id.

Can ou please help me for this issue why my all record are delete after upgrade database from wp_toolset_association table.

Thanks

#1805953

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Types 3.4 includes a migration to a new database structure for storing post relationships, to improve how translations of related posts are handled.

If you use the Relationships API (e.g. the toolset_get_related_posts function) then you won't be affected, they will still work.

If you are writing custom SQL queries, you'll need to study the new database structure so that you can update them.

The relationships are now stored using a combination of the toolset_associations table and a new toolset_connected_elements table.

The associations table now records the connections indirectly, of the "elements" in the other table, which stores the IDs of the posts themselves.

If you use phpMyAdmin or a similar tool to inspect the tables you should be able to see the same, it is reasonably self-explanatory.

You'll need to study this to identify what needs changing in your custom SQL query, which is not something we can provide support for I'm afraid.

Le sujet ‘[Fermé] Toolset association entry delete after database upgrade’ est fermé à de nouvelles réponses.