Skip to content

Commit

Permalink
Fix issue#123
Browse files Browse the repository at this point in the history
  • Loading branch information
mlojewski-me committed Apr 13, 2020
1 parent 765eeab commit d6cbc24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
### Fixed
- [issue#123](https://github.com/nextcloud/user_sql/issues/123) - sync exception - Duplicate entry

## [4.5.0] - 2020-04-13
### Added
Expand Down
8 changes: 2 additions & 6 deletions lib/Action/EmailSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ public function doAction(User $user)
$this->config->setUserValue(
$user->uid, "settings", "email", $user->email
);
\OC::$server->getUserManager()->get($user->uid)->triggerChange(
'eMailAddress', $user->email, null
);
\OC::$server->getUserManager()->get($user->uid)->setEMailAddress($user->email);
}

$result = true;
Expand All @@ -123,9 +121,7 @@ public function doAction(User $user)
$this->config->setUserValue(
$user->uid, "settings", "email", $user->email
);
\OC::$server->getUserManager()->get($user->uid)->triggerChange(
'eMailAddress', $user->email, null
);
\OC::$server->getUserManager()->get($user->uid)->setEMailAddress($user->email);
}

$result = true;
Expand Down
8 changes: 2 additions & 6 deletions lib/Action/NameSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ public function doAction(User $user)
$this->config->setUserValue(
$user->uid, "settings", "displayName", $user->name
);
\OC::$server->getUserManager()->get($user->uid)->triggerChange(
'displayName', $user->name, null
);
\OC::$server->getUserManager()->get($user->uid)->setDisplayName($user->name);
}

$result = true;
Expand All @@ -123,9 +121,7 @@ public function doAction(User $user)
$this->config->setUserValue(
$user->uid, "settings", "displayName", $user->name
);
\OC::$server->getUserManager()->get($user->uid)->triggerChange(
'displayName', $user->name, null
);
\OC::$server->getUserManager()->get($user->uid)->setDisplayName($user->name);
}

$result = true;
Expand Down

2 comments on commit d6cbc24

@yward
Copy link

@yward yward commented on d6cbc24 Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will this be pushed into live? I spent hours trying to debug the "duplicate" error until I found this fix and it works, thank you very much!

@mlojewski-me
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this this weekend

Please sign in to comment.