Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-17865

WebDAV access to Media tree fails

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • 4.4.0
    • Legacy > WebDAV
    • None
    • Operating System: Debian GNU/Linux 4.0
      PHP Version: 5.2.11-0.dotdeb.0
      Database and version: MySQL 5.0.84

    Description

      We have an eZP 4.4 site set up with WebDAV access, and accessing the WebDAV works well enough - except for the Media tree, which is what we need WebDAV for.
      In the Media tree, WebDAV shows 3 files, all with the name "Unknown displayname", instead of the expected folders "Files", "Images" and "Multimedia".

      I have tracked down the problem, and have attached a patch that I believe fixes it; it at least seems to work on this site.

      The problem is caused by the virtualization of the top-level folders, and is triggered by this site using old-style URL aliases where the path is all lowercase.

      All the belowmentioned methods are in the eZWebDAVContentBackend class.

      Because of the top-level folder virtualization, getVirtualFolderCollection() expects to see the virtual dir as the first path element. In itself, this is fine.

      However, for the media tree (indeed, any tree other than the content tree), fetchNodeInfo() uses the URL alias directly, without adding such a virtual folder. It does this because the path in the URL alias already contains an element for the media tree, but the problem is that the path thus generated uses the real media folder's URL alias instead of the virtual Media folder's name.

      This probably works on new, default, english installs of eZP (where the URL alias matches the translated virtual folder name), but in many other cases it will not.

      In my case, the URL alias part is the lowercase "media", which almost but not quite matches the translated virtual name "Media". Anyone who has renamed the media folder, or uses a translation where the virtual name is different (see e.g. #015035), will probably be hit by this issue.

      One workaround would be renaming the Media folder so that its URL alias matches the translated name.
      Another would be patching virtualMediaFolderName() to always return the same name as the Media folder's URL alias.

      However, I believe the proper fix is for fetchNodeInfo() to use the virtual name instead of the URL alias name, which is what the attached patch does.

      One note is that the attached patch hardcodes the URL alias name for the Media tree, which I did simply because internalNodePath() already hardcodes this path.

      It might be better to check the $node->attribute('path_array') for having node 43 as element 1, and possibly get that node ID from the configuration, but that's really only useful if the rest of the code is fixed similarly to use the configured Media tree instead of the default.

      Steps to reproduce

      Set up an eZP site with lowercase URL aliases (e.g. upgrade an old one), and WebDAV enabled.
      Connect with a WebDAV client, enter the siteaccess folder and Media folder, and look at the contents.
      Expected: the subdirs to be shown as subdirs and with their proper names.
      Actual: the subdirs are shown as files, with the name "Unknown displayname".

      Attachments

        Activity

          People

            unknown unknown
            edorfaus edorfaus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: