The MU forums have moved to WordPress.org

blog_id and user_id are different (4 posts)

  1. quenting
    Member
    Posted 19 years ago #

    Well, I don't know the origin of this problem, but after 6000 registrations, the blog_id and user id of newly registering people have became different. Is it normal it's possible this happens ? I felt this was the common key between the two entities blog and user. I used this common key for custom plugins, and now I have users doing something which impacts another user (the one with the previous ID).

    What to do ? Should I leave things and correct my plugins so they use another key to link blogs and users (if yes, what key ?).
    Or should I try to modify either user or blog IDs to match again. In this case, which one should i correct (add 1 to all falty user ids or take 1 from all falty blog ids) ?
    This has only happenned once, but it's really starting to screw things up a bit.

  2. suleiman
    Member
    Posted 19 years ago #

    quenting I'm just curious as to whether you solved this problem and if so how.

  3. dsader
    Member
    Posted 19 years ago #

    A single user id could have several blog ids. I use the following snip:

    $blogs = get_blogs_of_user($current_user->ID);

    Oh, that may need and "if" if a user has zero blogs, I think. Find the function in core first.

  4. quenting
    Member
    Posted 19 years ago #

    well, this wasn't really an issue as much as a question. The truth is, at least in the nightly I'm using, there isn't a real foreign key linking users to blogs. The link has to be figured from the domain/userid. What's sure is you must not assume blogs and users ids are the same, cause they're not.

About this Topic

  • Started 19 years ago by quenting
  • Latest reply from quenting