Skip Navigation

[Closed] Toolset association entry delete after database upgrade

This support ticket is created 3 years, 6 months ago. 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.

Our next available supporter will start replying to tickets in about 1.08 hours from now. Thank you for your understanding.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 11 replies, has 3 voices.

Last updated by Shane 3 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1836469

Hi Nigel,

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.

$origin_id = $post->ID;
$relationship_slug = 'assign-classroom-to-trainer';

$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.

Thanks

#1836791

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01: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.

#1838359

Hi Nigel,

Do you know did your database migration complete successfully? - Yes

You say that "the entries from toolset_association table are deleted".

Do you mean that the table is completely empty? - No not all entries deleted but some entries are deleted

If you need access then i will provide all entries there in old table but some entries delete from new table wp_toolset_association table.

Thanks

#1838519

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01: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?

#1839995

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

Are there any updates on this one ?

#1841213

Hi Nigel and Shane,

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.

if you need i will give you access of both site.

Thanks

#1847441

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

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.

Looking forward to hearing from you.

Thanks,
Shane

#1848259

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

#1848765

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

Thanks here are the private fields.
Thanks,
Shane

#1848971

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-11-18 at 2.11.11 PM.png
Screenshot 2020-11-18 at 2.11.24 PM.png

Hi 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?

Thanks,
Shane

#1857539

Hi Shane,

No not any error in SQL Log so what we can do further for this problem can you please suggest?

Thanks

#1857751

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marc,

It seems to be an issue on your end with your server.

What I can do is to backup the copy after the migration has done and send you.

However I believed I deleted the copy you sent me. Would you mind sharing it again so that I can do this?

Thanks,
Shane

The topic ‘[Closed] Toolset association entry delete after database upgrade’ is closed to new replies.