Skip Navigation

[Résolu] Toolset Membership Site deleting Relational CPTs with recent updates

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.

Auteur
Publications
#1197332

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

When you complete the steps I described there will no longer be a Writer post type (or, at least, any such posts will become redundant).

It was an intermediate post type used to simulate a many-to-many relationship between articles and members.

After merging the relationships as described there will be a true many-to-many relationship directly between articles and members, without the need for the intermediate writer post type.

So to display a member profile you will display it directly, not via the writer posts.

If you are showing an article (on its own, or in a list of articles), then you can create a View to display the member profile which is related to the article (using a relationship Query Filter), and then output fields directly from the member post without having to use the id="$member" attribute you needed to previously.

(I think I mentioned that doing the complete migration the right way would involve not just updating the relationships, but also the forms and Views that depend upon them.)

Don't hesitate to keep asking questions. It's not your fault the backwards-compatibility failed at some point, so I'm happy to give you whatever help you need.

#1197607
toolset-add-new-article.jpg

Hi Nigel,

We are getting there. Slowly but surely. 🙂

So I have the Add Writers displaying correctly and displaying for more then one article which is great (see attached screenshot). I have regenerated the Post Forms, both add new and edit. I have your new code in place.

I can connect an existing Member Profile on the backend to an article that was previously created which is great so I know I can reconnect all the old articles to their Members when it comes time.

Now the bad news, when I create a new article with the Post Form (Cred) the member is not automatically being connected to the article like we hoped. I know I can do this in the backend but the Members to this site will not have access to the backend and they only see the Cred forms on the frontend.

What should we try next to get members connecting to their articles on the frontend working again?

Thanks,
Ron

#1197764

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

OK, let me re-test the code I proposed on my local copy of your site to double-check that it works.

I'll get back to you a little later this morning.

#1197833

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2019-02-08 at 14.31.25.png

This appears to be working on my local copy of your site with the code I provided.

I logged in as webvisuals. That user has a member profile ID=4519 of Ron Ford.

I went to the page /my-account/create-new-article/ which contains form ID 3633 "New AAIMCo Article".

I submitted an article.

From some debug info I added I could see that the code I provided correctly identified id=4519 as the member profile post belonging to my user and it tried to connect that profile to the post I just published.

In the backend I found the article I just published and edited it to verify that the connection was successful, and as you can see in the screenshot, it was.

Can you confirm whether the problem you are having is with connecting the article and the profile (check the posts in the backend) or whether it is with displaying the connection on the front end?

I might need to get an update of your site to verify the changes you've made so far, but let me know about the above first.

#1198379

Hi Nigel,

I did a video to show you what I'm doing and where it breaks down.
hidden link

Since we are working on a backup feel free to go in on my site and bang away on it. If things break I have a backup that I could restore with.

thank you for your help.
Ron

#1198632

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2019-02-11 at 12.51.43.png

OK, well I'm happy to report that the explanation was very simple: you had added a code snippet, but not activated it (screenshot).

I activated it, than repeated the test from your video, and the profile was assigned to the new article.

(Boy was that a tough captcha, though, I had to click through well over 10 sets of images).

So... is there any left to fix?

#1198963

My issue is resolved now. Thank you! I will have to retrain my brain on how to work with this new way of doing relationships with Toolset and cred forms. Thanks to Nigel I have a good start!