Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files REPORT verb doesnt return queried custom properties #11817

Closed
jhomola79 opened this issue Oct 13, 2018 · 5 comments
Closed

Files REPORT verb doesnt return queried custom properties #11817

jhomola79 opened this issue Oct 13, 2018 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@jhomola79
Copy link

Steps to reproduce

  1. PROPPATCH new custom property to some folder for 'someuser'
  2. Request webdav REPORT verb against remote.php/dav/files/someuser/ with custom property specified in prop section of request payload

Expected behaviour

custom property value returns in response similar as it works for PROPFIND on affected resource

Actual behaviour

custom properties are never returned for files REPORT

Server configuration

Operating system: linux

Web server: apache

Database: postgres

PHP version: 7.0

Nextcloud version: (see Nextcloud admin page) 14.0.0

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: from downloaded archive

Maybe possible fix:

apps/dav/lib/Connector/Sabre/FilesReportPlugin.phpFilesReportPlugin->getFilesBaseUri

private function getFilesBaseUri($uri, $subPath) {
$uri = trim($uri, '/');
$subPath = trim($subPath, '/');
if (empty($subPath)) {
$filesUri = $uri;
} else {
$filesUri = substr($uri, 0, strlen($uri) - strlen($subPath));
}
$filesUri = trim($filesUri, '/');
if (empty($filesUri)) {
return '';
}
return '/' . $filesUri;
}

Do not
return '/' . $filesUri;
but only
return $filesUri;

Custom properties in column propertypath of properties db table are not stored with initial slash.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #11371 (NotFound Report on *.m file upload), #3137 (file chunk upload returns 404 error), #7160 (CSS Custom Properties (CSS Variables)), #3792 (Webdav upload file with .properties extension), and #4198 (Custom font file for TXT Preview).

@jhomola79
Copy link
Author

Sorry, suggested fix above is not that good...
Better it would be to change

$propFind = new PropFind($filesUri . $node->getPath(), $requestedProps);

to

$propFind = new PropFind(ltrim($filesUri, '/') . $node->getPath(), $requestedProps);

in apps/dav/lib/Connector/Sabre/FilesReportPlugin.phpFilesReportPlugin->prepareResponses($filesUri, $requestedProps, $nodes)

that only internal propfind is called without initial '/'.

@MorrisJobke
Copy link
Member

@jhomola79 Could I ask you to send in your changes a pull request right here on GitHub? Then we can directly comment on the code changes with the context of the surrounding code. Thanks

@jhomola79
Copy link
Author

Hi, I have spent some time trying to setup and run phpunit tests but no success yet. So I will try to make poll request without test in short time.

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@skjnldsv
Copy link
Member

As I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

4 participants