Making WordPress.org

Opened 5 weeks ago

Closed 4 weeks ago

#8455 closed defect (bug) (fixed)

Rosetta: Fix incorrect property assignment in User Sync

Reported by: timse201 Owned by: timse201
Priority: normal Milestone:
Component: Make (Get Involved) / P2 Keywords: has-patch
Cc:

Description

In WordPressdotorg\Rosetta\User\Sync::__construct(), $data->roles_to_sync is mistakenly assigned to $this->destination_site instead of $this->roles_to_sync.

Because of this typo:

  • $this->destination_site gets overwritten with the roles array when $data->roles_to_sync is passed.
  • $this->roles_to_sync remains uninitialized from the input data.
  • The setup() method may return early or methods expecting $this->destination_site to be a WP_Site instance fail.

Proposed solution:
Assign $data->roles_to_sync to $this->roles_to_sync.

Change History (4)

#1 @daxinigaurav
4 weeks ago

I've submitted a pull request to fix this issue by assigning $data->roles_to_sync to $this->roles_to_sync in WordPressdotorg\Rosetta\User\Sync::__construct().

PR: ​https://github.com/WordPress/wordpress.org/pull/1037

The change is limited to correcting the property assignment.

#2 @timse201
4 weeks ago

  • Keywords has-patch added

#3 @obenland
4 weeks ago

#8456 was marked as a duplicate.

#4 @obenland
4 weeks ago

  • Resolution → fixed
  • Status assigned → closed

In 15333:

Rosetta: Fix recursion handling, site ID usage, and property assignment in User Sync

Props timse201, obenland.
Closes ​https://github.com/WordPress/wordpress.org/pull/1006.
See #1983, #6326.
Fixes #8455.

Note: See TracTickets for help on using tickets.