Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Feb 7, 2019

Not sure when this is triggered, but it happens:

public function getRelativePath($path) {
if ($this->path === '' or $this->path === '/') {
return $this->normalizePath($path);
}
if ($path === $this->path) {
return '/';
} else if (strpos($path, $this->path . '/') !== 0) {
return null;
} else {
$path = substr($path, strlen($this->path));
return $this->normalizePath($path);
}

Exception

TypeError: Argument 3 passed to OC\Activity\Event::setObject() must be of the type string, null given, called in /var/www/html/apps/sharebymail/lib/ShareByMailProvider.php on line 323
  File "/var/www/html/lib/private/Activity/Event.php", line 377, in setObject
    public function setObject(string $objectType, int $objectId, string $objectName = ''): IEvent {
  File "sharebymail/lib/ShareByMailProvider.php", line 323, in publishActivity
    ->setObject('files', $fileId, $filePath);
  File "sharebymail/lib/ShareByMailProvider.php", line 257, in createShareActivity
    $userFolder->getRelativePath($share->getNode()->getPath())
  File "sharebymail/lib/ShareByMailProvider.php", line 757, in delete
    $this->createShareActivity($share, 'unshare');
  File "/var/www/html/lib/private/Share20/Manager.php", line 979, in deleteShare
    $provider->delete($share);
...
(13 additional frame(s) were not displayed)

Fix #14082

@nickvergessen
Copy link
Member Author

/backport to stable15

@nickvergessen
Copy link
Member Author

Sentry issue: NEXTCLOUD-NP

@kesselb kesselb mentioned this pull request Feb 7, 2019
Signed-off-by: Joas Schilling <[email protected]>
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

makes sense.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Tested and still works 👍

@MorrisJobke MorrisJobke merged commit 21671d5 into master Feb 7, 2019
@MorrisJobke MorrisJobke deleted the bugfix/noid/make-sure-the-path-is-always-a-string branch February 7, 2019 22:38
@backportbot-nextcloud
Copy link

backport to stable15 in #14101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants