You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue within the PermissionHelperService class of our Nextcloud Health app, specifically when trying to access the getParticipant() method's return value. The error message encountered is:
Exception: Cannot access offset of type string on string in file '/var/www/nextcloud/apps/health/lib/Services/PermissionHelperService.php' on line 89.
Upon reviewing the code, it seems that the method getParticipant() is expected to return an array or an object that includes a "uid" key. However, the actual return value appears to be a string. This discrepancy leads to a critical error when attempting to access the "uid" offset as if the return value were an array or an object.
Here is the problematic segment of the code for your reference:
public function getSharedPersonsOfCurrentUser(array $acls): array {
$personIds = array();
foreach($acls as $acl) {
if ($acl->getType() == Acl::PERMISSION_TYPE_USER && $acl->getParticipant()["uid"] == $this->userId) {
$personIds[] = $acl->getPersonId();
}
if ($acl->getType() == Acl::PERMISSION_TYPE_GROUP && $this->groupManager->isInGroup($this->userId, $acl->getParticipant()["uid"])) {
$personIds[] = $acl->getPersonId();
}
}
...
}
The text was updated successfully, but these errors were encountered:
I've encountered an issue within the PermissionHelperService class of our Nextcloud Health app, specifically when trying to access the getParticipant() method's return value. The error message encountered is:
Exception: Cannot access offset of type string on string in file '/var/www/nextcloud/apps/health/lib/Services/PermissionHelperService.php' on line 89.
Upon reviewing the code, it seems that the method getParticipant() is expected to return an array or an object that includes a "uid" key. However, the actual return value appears to be a string. This discrepancy leads to a critical error when attempting to access the "uid" offset as if the return value were an array or an object.
Here is the problematic segment of the code for your reference:
public function getSharedPersonsOfCurrentUser(array $acls): array {
$personIds = array();
foreach($acls as $acl) {
if ($acl->getType() == Acl::PERMISSION_TYPE_USER && $acl->getParticipant()["uid"] == $this->userId) {
$personIds[] = $acl->getPersonId();
}
if ($acl->getType() == Acl::PERMISSION_TYPE_GROUP && $this->groupManager->isInGroup($this->userId, $acl->getParticipant()["uid"])) {
$personIds[] = $acl->getPersonId();
}
}
...
}
The text was updated successfully, but these errors were encountered: