Forum Replies Created
-
AuthorPosts
-
August 10, 2021 at 10:34 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #30106
JC
ParticipantApologies for the late reply.
I have installed the latest MB User Meta plugin (v 1.2.9).
I have followed my replication instructions here.
The good news is that when I deleted the user who shared the same ID as the post, all other users who were associated with the post REMAINED associated with the post. (Previously they all lost their relationship with that post!) So this is great, thank you.
However, before I deleted the user who shared the ID with the post. I noticed this:

What I SHOULD be seeing here is this:

The post "TESTING" shares the same ID as the user.
So one bug fixed but another remains:
If the user shares the same ID as the post they are associated with. It doesn't render the user's associations correctly in the user profile
Thanks for your help π
June 30, 2021 at 6:14 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #29217JC
ParticipantThanks for responding.
Due to other work commitments I cannot test the updates at the moment. However, I will test these sometime in the next month and get back to you.
Thanks
May 8, 2021 at 10:38 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #28025JC
ParticipantI suspect you will be okay in your scenario because terms utilise the terms database table whereas posts, pages and custom post types utilise the posts table.
Matching IDs from the users table and the posts table is where problems lies.
However, I do not know for sure about terms; you'll have to test this by assigning multiple users to the same term and then deleting any user that shares the ID of said term (or vice versa) to see if everything remains intact as it should.
But still, this is a very significant bug. Developers, please chime in. Here is how you can replicate the issue. Thank you.
May 7, 2021 at 11:19 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #28012JC
ParticipantI think you'll be ok unless you are using MB Relationships with the MB User Meta plugin to make relationships between posts and users. If so, you will run into big problems if any of your user IDs share the same IDs with any other posts (of ANY post types).
I too would appreciate an update from the developers because this nearly crippled my website and I would love to see it patched for my own peace of mind and so other developers in the future do not experience what I had to.
I have implemented a hacky workaround as mentioned above BUT it will not last forever:
My short-term solution to the issue has been to change the auto-increment of the ID column in the users table to 1 million meaning any new user IDs will be 1M+1, 1M+2, 1M+3, etc, to ensure there will be no more ID collisions between users and posts (my post IDs are still relatively low, less than 200).
That will keep things working on my website for a long time. It's unlikely but if the post IDs in the future exceed 1M, the problem will come back because there will again be user IDs that match post IDs and the problem will persist.
March 25, 2021 at 7:06 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #26690JC
ParticipantHello, I am bumping this thread because this is a major bug!
Please see my previous post (this one) for instructions about how to replicate this issue.
This is actually worse than I first thought.
I just deleted a standard page (standard pages have no MB relationships set up on my installation at all).
The page had an ID of 55.
When I then checked the user with an ID of 55, this user no longer has any of the relationships they had before I deleted the completely unrelated page!
This means if I delete ANY post type that happens to share an ID with a user, all of that userβs relationships disappear!
This is a very big problem!
Thanks for reading.
February 23, 2021 at 6:17 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #24595JC
ParticipantUPDATE:
This is actually worse than I first thought.
I just deleted a standard page (standard pages have no MB relationships set up on my installation at all).
The page had an ID of 55.
When I then checked the user with an ID of 55, this user no longer has any of the relationships they had before I deleted the completely unrelated page!
This means if I delete ANY post type that happens to share an ID with a user, all of that user's relationships disappear!
This is a very big problem!
Thanks for reading.
February 23, 2021 at 4:00 PM in reply to: β Massive bug found (?) with relationships between posts and users!!!! #24590JC
ParticipantThank you very much for your swift response.
You have slightly misunderstood the issue.
The (related) post does not get deleted; that stays intact like you have found.
The issue is ALL other users that had a relationship with that post no longer have a releationship with it.
To replicate the issue:
- Create three new users
- Create one new post
- Make a relationship between the three new users and the new post
- Make one of the users have the same ID as the post
- Delete the user who has the same ID as the post
Once deleted, the remaining two users will no longer have a relationship with the post.
My short-term solution to the issue has been to change the auto-increment of the ID column in the users table to 1 million meaning any new user IDs will be 1M+1, 1M+2, 1M+3, etc, to ensure there will be no more ID collisions between users and posts (my post IDs are still relatively low, less than 200).
That will keep things working on my website for a long time. It's unlikely but if the post IDs in the future exceed 1M, the problem will come back because there will again be user IDs that match post IDs and the problem will persist.
I hope I have made things a little clearer. If you need to know anything else, let me know and I'll be happy to explain further.
Thank you
October 26, 2020 at 4:52 PM in reply to: β User to Post Relationship - Remove Metabox From User Profile #22580JC
ParticipantThank you, that makes a lot of sense. I missed this in the docs.
When setting up the relationship, I went from users to posts, not from posts to users. Thankfully I haven't deployed the website yet so I can change this and make reciprocal = true.
Out of curiosity, is there a way to remove the metabox from the "from" side? Or must it always be the metabox on the "to" side that is removed?
Thanks again.
October 18, 2020 at 12:25 AM in reply to: β Add more than one relationship at a time (MB_Relationships_API::add ) #22440JC
ParticipantOk thank you for your help. No worries, I'll keep doing it the way I'm doing it for now.
All the best
October 17, 2020 at 4:01 PM in reply to: β Add more than one relationship at a time (MB_Relationships_API::add ) #22435JC
ParticipantThank you for your reply.
I have done this (registered a relationship between users and posts).
My use case is this: a user pays for access to a post and upon payment the user is "added" to the post which gives them access to it.
But if the user needs to be "added" to more than one post (if they buy access to 3 posts, for instance), I have to wrap the Add function in a loop to add user to post 1, post 2, post 3 and so on separately.
My question still remains, can I "add" a user to more than one post in one request. Or am I limited to the loop solution, one by one?
I hope I made it a little clearer this time.
Or perhaps there's a better way of achieving this and I'm missing something?
Thanks again π
-
AuthorPosts