Skip Navigation

[Resolved] many-to-many relationship, losing dropdown values in admin, suspect slow ajax

This thread is resolved. Here is a description of the problem and solution.

Problem:
When you update a Parent or Child Post, it looses the relevant relations to Child or Parent Posts.

Solution:
This is solved with a provisory patch since Types 2.2.1 and will be definitely solved as soon the new rewamp of the Many to Many relationships is released (not yet scheduled)

Anyhow this is no an issue anymore with any current stable Types Release Version.

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 3 voices.

Last updated by markD-13 7 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#422077
should look like this.jpg
broken links.png
promotion admin.png

Client is a retail chain with regional promotions, with participating stores. I have created a post type called "promotion stores" for many-to-many relationship between custom post type promotions (via types) and custom post type stores(3rd party plugin).

The problem is that sometimes the stores linked to the promotion lose their value and it breaks the view on the front end. I suspect its because the dropdowns are loaded via ajax and the "add new promotion store" functionality in the promotion edit screen causes an ajax reload of all the existing dropdowns for existing linked stores. I'm guessing if the user clicks update before all the dropdowns are set then the value for the store is lost. On the front end instead of displaying a link to the store it displays a slug for the "promotion store" custom post type

Please let me know how i can get around this. I have asked the client to make sure the dropdowns are loaded before clicking save but this is not a long term solution.

#422095

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Actually - this is a usability issue and our development team is aware of this issue and we are working on it to improve it.

Our development team is planning to provide a solution within the next two next releases.

You can check the Types plugin changelog page: https://toolset.com/download/toolset-types/#changelog for the two versions after 2.1 to make sure that this is fixed.

As a workaround:
set the Child post Table to as example display only 10 items a time.
- This will load them fast.
- Then you can paginate and also this will load fast.

#427001

Hi Toolset support/Minesh,

Just wondering when you guys plan on releasing a fix? Our client is needing a solution and a redev without types/Views is just not feasible.

Any ballpark estimate would go a long way to putting my client at ease.

Thanks.

#427004

Since Minesh currently has a few days off, I will replace him here in the forum.
I hope this is OK for you.

I tested today a new patch for this issue, which seems to make sense.

I want to be sure I did not miss anythign and would like to ask you if you can give it a try as well?

If so, do that only on a Test Site or after a 100% valid backup.

I would then send you a copy of the Develop Version of types, where the patch is active.

To do so I will need FTP access and upload the Plugin to a folder in the FTP.

Would you be able to provide that?

#427964

We have implemented a fix for this in Types 2.2.1 - which has been released a few minutes ago.

Please aknowldege that this is a fix that will live until we rewamp the entire Many To Many relationship.

Then, this will be solved for good anyway.

For now, to prevent the multiple ajax calls for each field we gave the fields a new "frozen" state with only the title. Once you are clicking it, the select2 is loaded.
That avoids data loss as the Select2 are not initailized if not clicked, and threfore nothing can get lost (the value is frozen)

If you find any other problems, please let us know in a new ticket.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.