[Fermé] Toolset association entry delete after database upgrade
This support ticket is created Il y a 4 années. 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.
My previous ticket is continue here because previous ticket closed which is created October 9, 2020 at 10:41 am please see my issue below
I have tried using above function "toolset_get_related_posts" but still my entries are not coming.
I have relationships using two post type trainer-classroom and student-classroom from student and trainer post i am assigning classroom using relationship but if i need all the trainer of that classroom i am using the function you given but after upgrade DB as per Toolset Notice it's not working also the entry from toolset_association table are deleted and all entry are there in toolset_association_old table in my DB. My code is as below.
$trainer = toolset_get_related_posts(
$origin_id, // get posts connected to this one
$relationship_slug, // in this relationship
array(
'query_by_role' => 'parent', // origin post role
'role_to_return' => 'child', // role of posts to return
'return' => 'post_id', // return array of IDs (post_id) or post objects (post_object)
'limit' => 999, // max number of results
'offset' => 0, // starting from
'orderby' => 'title',
'order' => 'ASC',
'need_found_rows' => false, // also return count of results
'args' => null // for adding meta queries etc.
)
);
echo "<pre>";
print_r($trainer);
Above code return blank array.please give me reply and let me know if you need my site access.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi Marc
That looks correct, your use of toolset_get_related_posts.
Do you know did your database migration complete successfully?
You say that "the entries from toolset_association table are deleted".
Do you mean that the table is completely empty?
All of the post connections are stored in that database table (but the post IDs are no longer recorded there, they are stored in the related toolset_connected_elements table).
If that table is empty, then something has gone wrong.
You should be able to roll-back the update from the relationships page or the debug page accessed from the settings page.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
How may missing entries are we talking about?
The migration sometimes finds broken associations—connections between two posts where one of the posts is missing, for example—and discards them, which it reports in the on-screen log as the migration progresses, and so it is not uncommon for there to be fewer rows in the post-migration table than in the pre-migration table.
How many rows are in wp_toolset_association and how many in wp_toolset_association_old?
wp_toolset_association table and toolset_association_old table both have no of entry same but when i am accessing using above function it not return anything but same function i use in my live site where i have not upgraded DB it return all entry.
Do you have a previous backup of the site before you've performed the updates? If so are you able to provide access to it as well as the link to the page where your code is returning the results?
I would like to grab a copy of it and perform the update on our end to see if the same results will occur with the tables. I know our development team is working on a few of the migration issues and we are scheduled for an update of our plugins for next week if all the testing goes well.
Hi Shane,
i created a backup from a version of the website (the live version actually) where the update is not performed yet. I have a link to WeTransfer. Can you create a private reply so i can share?
Thanks!
Marc
Not sure what happened on your server's end but I just ran the migration on my end and bother the wp_toolset_associations and wp_toolset_associations_old both have records. See Screenshots.
Perhaps your migration wasn't done completely in its entirety. What I can do is if you like I can provide you with the duplicator package that i'm using now.
Not sure what happened on your end but your migration didn't run successfully. Were there any errors in your sites SQL logs?