Skip Navigation

[Resolved] Custom Post Relationship not being added and error on debug log

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

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

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 2 voices.

Last updated by Christian Cox 6 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1141088
CleanShot 2018-11-06 at 02.36.31.png
CleanShot 2018-11-06 at 02.22.22.png

I am trying to:

We created an resources interface with the free Types plugins a good 3 years ago. Just recently we decided to purchase the full version, and after installing it, all our post relationship were migrated to some new format.

Everything working fine so far until we tried to add more items to our interface (Created with Types Custom Post Type and Child relationships), now we can't add new items, and the backend interface/metabox is displaying the wrong number of items, there should be 14, we see 10 only.

Link to a page where the issue can be seen:

hidden link
hidden link

I expected to see: All our resources-files (Child of resources) been added and displaying correctly)

Instead, I got:

Instead, it displays the message it was added, but is not, and we had to increase the pagination under the Screen Options, so we can see more items, otherwise it just shows 10 even when there are 14-15.

Something is working incorrectly, and we found this line in the debug.log when we try to add a new item:

PHP Notice: Undefined property: WPCF_Repeater::$order_meta_name in /srv/users/serverpilot/apps/frs-production/public/wp-content/plugins/types/vendor/toolset/types/embedded/classes/repeater.php on line 151

We definitively need someone to check that after the migration, everything is still working as it was with the free types plugin, and to figure out the reason why it is behaving incorrectly.

We are available to explain in the site what is happening. Please let us know what do we need to provide. If you check the screenshows attached, you will notice the guid column on the posts table is now saving with a different format. None of this items are displaying in the front end, with the ones that were added previous to the migration.

#1141537

Hi, there's nothing inherently wrong about the new guid format you're seeing now in the post table. However if related posts are not appearing as expected in the Post Relationship panel, that indicates a problem. I've seen some similar issues recently that are related to caching, and I can see you have Redis and WP Optimize active on your site.
- Is it possible to temporarily deactivate those two systems, as well as any other server-side caching mechanism(s)?
- If not is it possible to purge those caches without deactivating them?
- Do you have a staging environment set up where you can run other tests, like turning other plugins on and off? Let's try deactivating all plugins except Types, and activating a default theme like Twenty Seventeen. Then test again.
- If the problem was resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem was not resolved, I'll need to take a closer look.

#1142451

Hi Christian

The problem is Redis, or rather I say Toolsets with Redis Caching active. If we clear the Redis Object Cache everything shows up as it should, my question is: Is there a way for both of them to co-exist? Is there a way that when a new post (CPT) is created the cache gets clear like every other plugin does when Redis is present? I hunted down some old post on this forums where people were having similar issues, so this is a long happening issue. Also, it did not happen with the free version of Types, which we have used for 3+ years and Redis been active on our site also for quite a long time now, and we never encounter this issue. Why is it that now with the new (Paid) version of Types, this happens?

Thanks for you for your time.

#1142515

Is there a way that when a new post (CPT) is created the cache gets clear like every other plugin does when Redis is present?
I will ask for some additional information from my 2nd tier team. The most likely reason is that the Redis system is hooked into some event that our post relationship API doesn't trigger, like save_post. Our post relationship API isn't hooked into save_post, it's a separate action. If a caching system isn't designed to listen to events like our post relationship API events, it won't trigger an update. Then the question becomes - should we trigger some other event, or should Redis be configurable to listen to custom events? I'll let you know what I find out.

Why is it that now with the new (Paid) version of Types, this happens?
The most likely reason is that the new version of Types includes a completely different post relationship system. The new relationship system utilizes custom database tables, where the old post relationship system used the postmeta table. Apparently the postmeta table was cached less aggressively, or Toolset triggered a cache update for that table more effectively. I don't have the technical reason but hopefully we can get clarification soon.

#1143044

The cache problem has been added to our list of known issues, and we will continue to investigate.
https://toolset.com/errata/object-cache-breaks-the-post-relationship-editor-on-single-related-posts/

#1143083

Hi Christian

Thanks for taking the time to look into this, and for giving it the proper importance.

We truly appreciate it.

#1143201

I am updating the ticket status, no need to reply right now.

#1146515

Our team has informed me that the fix for this problem will be included in Types 3.2. If I receive a patch file before that release, I will let you know as soon as possible.

#1155513

Hi, Types 3.2 is now available for download or automatic update. Please update to the latest version of all Toolset plugins and let me know if the problem is not completely resolved.