October 19, 2018 at 9:00 PM #11679Resolved
I used the drag and drop functionality to arrange the relationships in the exact order I needed them to show on the front-end. Now they have reverted back to where when they were added to the database. Where is the order stored in the db? Why would it revert back? Frontend and backend match up so I know that there is not a sort order on the frontend.
December 12, 2018 at 2:39 AM #12608
Nice one Doug. I am seeing the same thing.
Looks like the storage interface doesn’t have the db param.
I think Anh removed the parameter in favor of the direct reference of `global wpdb’.
The storage handler should do the same global reference probably.December 14, 2018 at 12:06 PM #12667
Thanks a lot for testing! I’ve fixed the bug that Doug pointed out. This bug prevents the data from saving. Can you please try the latest version on Github?
It’s the dev version and not the same as 1.4.1 version on .org. I will release version 1.5.0 if this works 🙂December 14, 2018 at 12:27 PM #12669
Ahn – I just installed the dev version from GitHub. I can load, view, and save relationships again. But the original issue Clayton pointed out at the beginning of this thread is still happening.
For example, and to be clear what’s happening… I have an EVENT post type and a relationship specified with a SPEAKER post type. Each EVENT typically has multiple SPEAKERs associated with it, and I have arranged those SPEAKERS in a specific order in the Relationship metabox on the relevant EVENT post admin page, and I want that order maintained.
Assume those speakers are arranged like this:
If I open up the SPEAKER 1 post and Update it, then go back to the relevant Event admin page, the new order in the Speaker metabox will now be:
Sure, I can drag them back to the correct order. But I have to remember to do this. Seems like a specified order of posts should be maintained, regardless of whether any of them have been modified since the original relationships were created and order was specified.
Sorry, long-winded. But hopefully clear what we see happening that is unexpected.December 14, 2018 at 2:21 PM #12670
Anh TranKeymasterDecember 15, 2018 at 12:29 AM #12680
Thanks for the video, Anh.
I created a fresh install of WP just for this, installed Meta Box, MB Custom Post Type, MB Relationships, and the Twenty Seventeen theme, and duplicated the steps you took in your first video. And yes, it’s working for me right now — order is preserved after updating a speaker post.
But our staging and production servers are still bumping the last updated post to the bottom of the list. I’m going to slowly add back in pieces of our staging environment (plugins, theme files) to see if I can pinpoint what it is that causes the posts to reorder. If I find what it is, I’ll report back here.December 15, 2018 at 12:31 AM #12681
These videos look great. Looks like you have the defaults ort order in the admin set to use the new database columns? I like this being the default. Once it is set, they should not change.
I can’t seem to find the github repo for the
devbranch. All I see is
check_relationship.December 15, 2018 at 12:33 AM #12682
Doug, where are you finding the new package?December 15, 2018 at 12:45 AM #12684
Update: Actually, scratch my report above. I think it’s working on our staging server now too.
Just went back to test one more time, and related post order is preserved on our staging server too. Not sure why I saw it move yesterday, since I haven’t changed any of the plugins. But this issue seems to be fixed from what I can see. Thank you!
@Clayton – I don’t think there is a separate dev branch on GitHub. Since I don’t see any dev branches either, I’m betting GitHub is dev for the MB team. I just grabbed master of MB Relationships and installed from that.December 15, 2018 at 12:58 AM #12685
Thanks Doug. I did the same.
Ahn, ran similar tests and it looks great. Please push the updates.
Thanks for everything! This is a huge lifesaver for my clients.December 15, 2018 at 1:14 AM #12686
Ok, one more update from me. I just updated MB Relationships on our production server too. Tested by updating one of our speakers, and then checking the event, and that speaker was bumped to the bottom of the list.
However, after dragging the speaker back to the correct position on the event page, updating, then updating the same speaker again, the order was preserved. And it’s preserved every time now for that event.
I tested our other events, here’s what I found (that mirrors what Clayton notes above)…
Any new relationships that get created with the updated plugin code should preserve order, because of the way index order is getting set now. But for any existing posts that had relationships defined before updating the plugin, you must go into each of those posts, and update each post once to establish an index order for its related posts. Then specified post order will be preserved from that point forward.
You must be logged in to reply to this topic.