Skip to content

Incorrect Usages of blog.getId() and blog.getBlogId()? #607

@roundhill

Description

@roundhill

I think some poor naming has caused some problems in the app. In the Blog model we have getId() and getBlogId().

  • The 'id' is the local id of the blog, corresponds to the unique key in the local SQLite blog table.
  • The 'blogId' is the remote blog ID, which is typically just '1' for WordPress.org blogs, and on Multi-site and WordPress.com it is a unique integer that identifies the individual blog across the site instance.

The problem I'm seeing is that we are often using getBlogId() as the key for other objects, such as in Media. If a user has multiple self-hosted blogs with a blogId of '1' then they are going to see media items for both blogs when they visit media.

I think we need to rename these to be clearer, and do an audit of the app and fix instances where we should use the id instead of the blogId.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions