Conversation
When the following options are enabled in Nextcloud 13.0.0 the ContactsMenu fails to load.
```
Restrict users to only share with users in their groups
Allow username autocompletion in share dialog. If this is disabled the full username or email address needs to be entered.
```
The issue is traced back to:
### /lib/private/Contacts/ContactsMenu/ContactsStore.php
```PHP
$contactGroups = $this->groupManager->getUserGroupIds($this->userManager->get($entry->getProperty('UID')));
```
You'll get the error:
```
TypeError: Argument 1 passed to OC\Group\Manager::getUserGroupIds() must implement interface OCP\IUser, null given, called in /nextcloud/lib/private/Contacts/ContactsMenu/ContactsStore.php on line 161
```
Regression of #5585. @LEDfan would you mind taking a look? I'd suggest to check whether the user manager actually returns a user for the given UID before passing it to the group manager. |
| * @return array with group ids | ||
| */ | ||
| public function getUserGroupIds(IUser $user) { | ||
| public function getUserGroupIds(IUser $user = null) { |
There was a problem hiding this comment.
I'd rather fix the code that calls the method incorrectly than fixing it here. See #8765 (comment)
|
Correct NULL should not be passed in. Just check before calling if it is not null. Thus closing this. |
|
This was closed without any fix referenced. This issue is not one of a third party code but one of Nextcloud itself. As originally stated the issue happens when specific options are selected in the settings. |
When the following options are enabled in Nextcloud 13.0.0 the ContactsMenu fails to load.
The issue is traced back to:
/lib/private/Contacts/ContactsMenu/ContactsStore.php
You'll get the error: