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

webdav search select displayname property returns http 404 #17778

Closed
khameed opened this issue Nov 1, 2019 · 10 comments · Fixed by #34508
Closed

webdav search select displayname property returns http 404 #17778

khameed opened this issue Nov 1, 2019 · 10 comments · Fixed by #34508
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: dav

Comments

@khameed
Copy link

khameed commented Nov 1, 2019

In nextcloud-server 17.0.0.9, performing a webdav basicsearch with select "displayname" property results in a 404 for this property in the multistatus.

Search Body:

<d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
    <d:basicsearch>
        <d:select>
            <d:prop>
                <oc:fileid/>
                <d:getlastmodified/>
                <d:displayname/>
            </d:prop>
        </d:select>
        <d:from>
            <d:scope>
                <d:href>/files/admin/Documents</d:href>
                <d:depth>infinity</d:depth>
            </d:scope>
        </d:from>
        <d:where>
            <d:like>
                <d:prop>
                    <d:getcontenttype/>
                </d:prop>
                <d:literal>text/%</d:literal>
            </d:like>
        </d:where>
        <d:orderby>
            <d:prop>
                <oc:size/>
            </d:prop>
            <d:ascending/>
        </d:orderby>
    </d:basicsearch>
</d:searchrequest>

Response:

<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/files/admin/Documents/About.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>9</oc:fileid>
        <d:getlastmodified>Tue, 15 Oct 2019 13:16:01 GMT</d:getlastmodified>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    **_<d:propstat>
      <d:prop>
        <d:displayname/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>_**
  </d:response>
</d:multistatus>

@khameed khameed added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 1, 2019
@radoslavius
Copy link

Same in 16.0.4

@kesselb
Copy link
Contributor

kesselb commented Nov 16, 2019

Hmm. Has that worked before? The patch below will add the displayname. What would you expect as displayname? Filename with extension, filename without extension, relative path or something else?

Index: apps/dav/lib/Connector/Sabre/FilesPlugin.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- apps/dav/lib/Connector/Sabre/FilesPlugin.php	(revision a27c10daa66a38c453393fcaf0c545d60f041f30)
+++ apps/dav/lib/Connector/Sabre/FilesPlugin.php	(date 1573940119097)
@@ -304,6 +304,10 @@
 				return $node->getFileId();
 			});
 
+			$propFind->handle('{DAV:}displayname', function () use ($node) {
+				return $node->getName();
+			});
+
 			$propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function() use ($node) {
 				return $node->getInternalFileId();
 			});

@kesselb
Copy link
Contributor

kesselb commented Nov 17, 2019

cc @rullzer @icewind1991 @tobiasKaminsky as the dav experts ;) Any idea why displayname is not exposed?

@khameed
Copy link
Author

khameed commented Nov 17, 2019

Hmm. Has that worked before? The patch below will add the displayname. What would you expect as displayname? Filename with extension, filename without extension, relative path or something else?

Index: apps/dav/lib/Connector/Sabre/FilesPlugin.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- apps/dav/lib/Connector/Sabre/FilesPlugin.php	(revision a27c10daa66a38c453393fcaf0c545d60f041f30)
+++ apps/dav/lib/Connector/Sabre/FilesPlugin.php	(date 1573940119097)
@@ -304,6 +304,10 @@
 				return $node->getFileId();
 			});
 
+			$propFind->handle('{DAV:}displayname', function () use ($node) {
+				return $node->getName();
+			});
+
 			$propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function() use ($node) {
 				return $node->getInternalFileId();
 			});

There is no other property which provies the file name, I would expect displayname to be the file name with extension.

@marohds
Copy link

marohds commented Dec 30, 2019

Same issue here...
Seems like displayname works only for search. I was able to filter files by name this way:
<?xml version="1.0"?><d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> <d:basicsearch> <d:select> <d:prop> <oc:fileid/> <d:displayname/> <d:getcontenttype/> <d:getetag/> <oc:size/> <oc:owner-display-name/> </d:prop> </d:select> <d:from> <d:scope> <d:href>/files/xxxx</d:href> <d:depth>10</d:depth> </d:scope> </d:from> <d:where> <d:like> <d:prop> <d:displayname/> </d:prop> <d:literal>ds%</d:literal> </d:like> </d:where> <d:orderby/> </d:basicsearch> </d:searchrequest>

@dimmu311
Copy link

i run Nextcloud on version 18.
i try to make a webdav api call to find files changed during last 7 days. During my work i found that the response is 404 error for display name. Same as described here.
If i check the sources, i see that this patch is not in the sources until now.
Do somebody know if this should work, or if there is still an issu?

@szaimen
Copy link
Contributor

szaimen commented Jun 22, 2021

Is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

@ThumbGen
Copy link

Yes, this is still an issue. It would be great to have it fixed. And, in general, to make sure the WebDAV protocol is fully implemented.

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of enhancement feature: dav and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info labels Jul 13, 2021
@holger-dev
Copy link

still an issue...fix would be great!

@djohn156
Copy link

It seems this issue also applies to owner-id, owner-display-name and checksums, Nextcloud Version 22.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: dav
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants