Skip to content

Cannot get custom WebDAV properties back after setting them #12862

Closed

Description

@PVince81

Steps to reproduce

  1. Create a file "testprops.txt"
  2. Create a file "proppatch.txt" with the following contents:
<?xml version="1.0"?>
<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:set>
    <d:prop>
      <oc:testprop>Test property</oc:testprop>
    </d:prop>
  </d:set>
</d:propertyupdate>
  1. Run a PROPPATCH with curl using that file:
curl -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatch.txt"  http://root:admin@localhost/owncloud/remote.php/webdav/testprops.txt`
  1. Run PROPFIND on that file: curl -X PROPFIND http://root:admin@localhost/owncloud/remote.php/webdav/testprops.txt
    Result:
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/owncloud/remote.php/webdav/testprops.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>00000066oc11qbmm0afb</oc:id>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getetag>"f9836b73ac0074b6b35b9b8efe815670"</d:getetag>
        <d:getlastmodified>Mon, 15 Dec 2014 16:34:47 GMT</d:getlastmodified>
        <d:getcontentlength>0</d:getcontentlength>
        <d:resourcetype/>
        <d:getcontenttype>text/plain</d:getcontenttype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
  1. Check the database: select * from oc_properties where propertypath = '/testprops.txt';
+----+--------+----------------+----------------------------------+---------------+
| id | userid | propertypath   | propertyname                     | propertyvalue |
+----+--------+----------------+----------------------------------+---------------+
|  2 | root   | /testprops.txt | {http://owncloud.org/ns}testprop | Test property |
+----+--------+----------------+----------------------------------+---------------+

Expected result

PROPFIND should return the property "oc:testprop".

Actual result

The custom property "oc:testprop" doesn't appear in the result set.
The code to read properties is present but doesn't seem to work.

Versions

master (036456f)

@DeepDiver1975 @icewind1991 I guess this hasn't been tested since a while.
Found while trying to add a special "oc:tags" property: #12856

Activity

  1. PVince81 commented on Dec 15, 2014

    @PVince81
    ContributorAuthor

    Hmm seems to be related to the "properties that the client has requested". Since I didn't request any special properties, it seems to default to a smaller set of props.

  2. PVince81 commented on Dec 15, 2014

    @PVince81
    ContributorAuthor

    Okay I seem to be able to read it if I explicitly ask for it:

    1. Create a file "propfind.txt":
    <?xml version="1.0"?>
    <a:propfind xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns">
    <a:prop><a:getcontenttype/></a:prop>
    <a:prop><oc:testprop/></a:prop>
    </a:propfind>
    
    1. Then curl -X PROPFIND -H "Content-Type: text/xml" --data-binary "@propfind.txt" http://root:admin@localhost/owncloud/remote.php/webdav/testprops.txt
      Gives:
    <?xml version="1.0" encoding="utf-8"?>
    <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
      <d:response>
        <d:href>/owncloud/remote.php/webdav/testprops.txt</d:href>
        <d:propstat>
          <d:prop>
            <oc:id>00000066oc11qbmm0afb</oc:id>
            <oc:permissions>RDNVW</oc:permissions>
            <oc:testprop>Test property</oc:testprop>
            <d:getcontenttype>text/plain</d:getcontenttype>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
    </d:multistatus>
    

    So possible a duplicate of #11803

  3. DeepDiver1975 commented on Dec 15, 2014

    @DeepDiver1975
    Contributor

    FYI: litmus is testing this - as long as we execute litmus from time to time 🙊

  4. PVince81 commented on Feb 12, 2015

    @PVince81
    ContributorAuthor

    This is by design. Custom props must be requested explicitly.

  5. locked as resolved and limited conversation to collaborators on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions