Skip to content

[Bug]: Invalid type for field favorite #41630

@tobiasKaminsky

Description

@tobiasKaminsky

⚠️ This issue respects the following points: ⚠️

Bug description

Webdav SEARCH for favorite is not working

Steps to reproduce

  1. create a folder
  2. mark it as favorite
  3. do webdav SEARCH:
curl --request SEARCH \
  --url http://localhost:8080/remote.php/dav \
  --header 'Authorization: Basic dGVzdDp0ZXN0' \
  --header 'Content-Type: text/xml' \
  --header 'OCS-APIRequest: true' \
  --data '<?xml version="1.0" encoding="UTF-8"?>
<d:searchrequest xmlns:d="DAV:" xmlns:nc="http://nextcloud.com/ns"
								 xmlns:oc="http://owncloud.com/ns">
		<d:basicsearch>
			<d:select>
				<d:prop>
					<d:displayname/>
					<d:getcontenttype/>
					<d:resourcetype/>
					<d:getcontentlength/>
					<d:getlastmodified/>
					<d:creationdate/>
					<d:getetag/>
					<d:quota-used-bytes/>
					<nc:sharees xmlns:nc="http://nextcloud.org/ns"/>
					<d:quota-available-bytes/>
					<oc:permissions xmlns:oc="http://owncloud.org/ns"/>
					<oc:id xmlns:oc="http://owncloud.org/ns"/>
					<oc:size xmlns:oc="http://owncloud.org/ns"/>
					<oc:favorite />
				</d:prop>
			</d:select>
			<d:from>
				<d:scope>
					<d:href>/files/test</d:href>
					<d:depth>infinity</d:depth>
				</d:scope>
			</d:from>
			<d:where>
				<d:eq>
					<d:prop>
						<oc:favorite xmlns:oc="http://owncloud.org/ns"/>
					</d:prop>
					<d:literal>yes</d:literal>
				</d:eq>
			</d:where>
			<d:orderby/>
	</d:basicsearch>
</d:searchrequest>'
  1. See:
HTTP 500 error
<?xml version="1.0" encoding="utf-8"?>
<d:error
	xmlns:d="DAV:"
	xmlns:s="http://sabredav.org/ns">
	<s:exception>InvalidArgumentException</s:exception>
	<s:message>Invalid type for field favorite</s:message>
</d:error>

Expected behavior

folder should be shown

Installation method

None

Nextcloud Server version

master

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

☑️ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions