nextcloud / nextcloud/groupfolders

DAV based `SEARCH` in a subfolder of a groupfolder does not return results

Open
#2,583 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Involved app: groupfolders:
https://apps.nextcloud.com/apps/groupfolders

Searching in a sub folder of a group folder (/files/user/a_groupfolder/a_subfolder) does not return any results, although files are available there,

         <d:from>
             <d:scope>
                 <d:href>/files/user/a_groupfolder/a_subfolder</d:href>
                 <d:depth>0</d:depth>
             </d:scope>
         </d:from>

but when searching directly in the group folder (/files/user/a_groupfolder), files from a_groupfolder/a_subfolder are found.

         <d:from>
             <d:scope>
                 <d:href>/files/user/a_groupfolder</d:href>
                 <d:depth>0</d:depth>
             </d:scope>
         </d:from>

This only happens in groupfolders, files in sub folders of shared folders or normal user folders are found.

Steps to reproduce

Curl-Session:

curl -u user:pw 'https://server.org/remote.php/dav/' -X SEARCH -H "content-Type: text/xml" --data '<?xml version="1.0" encoding="UTF-8"?>
 <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/>
             </d:prop>
         </d:select>
         <d:from>
             <d:scope>
                 <d:href>/files/user/a_groupfolder/a_subfolder</d:href>
                 <d:depth>0</d:depth>
             </d:scope>
         </d:from>
         <d:where>
            <d:like>
                <d:prop>
                    <d:displayname/>
                </d:prop>
                <d:literal>%filepartname%</d:literal>
            </d:like>
         </d:where>
         <d:orderby/>
    </d:basicsearch>
</d:searchrequest>'

Result (empty):

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"/>
Expected behavior

An XML response with the existing files in the sub folder of the group folder.

Installation method

None

Nextcloud Server version

26

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the DAV SEARCH request through remote.php/dav against a groupfolder root and its subfolder, comparing the returned paths. Trace the groupfolders handling of scoped searches and compare it with normal and shared folders; done means the subfolder request returns an XML response containing the existing matching files.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.