Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8925

The WebDAV edit attachment link is not generated when URLs are rewritten

    Details

    • Difficulty:
      Easy
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The DAV Edit attachment link is generated for each attachment in attachmentsinline.vm:

      ## Dav Edit attachment link. We display the link hidden by default, and let the WebDAV JSX extension display it if
            ## the browser supports Dav Edit 
            #set($documentUrl=$doc.getExternalURL("download"))
            #set($attachmentUrl="$documentUrl/$attach.filename")
            #set($attachmentSignature="${request.contextPath}${request.servletPath}/download/")
            #set($webdavSignature="${request.contextPath}/webdav/spaces/")
            #set($fragments=$attachmentUrl.split($attachmentSignature))
            #if($listtool.size($fragments) == 2)
              #set($prefix=$listtool.get($fragments, 0))
              #set($suffix=$listtool.get($fragments, 1))
              #set($davUrl="$prefix$webdavSignature$suffix")
              <a title="$msg.get('core.viewers.attachments.webdavEdit.title')" class="editlink hidden" href="$davUrl" onclick="if(XWiki && XWiki.WebDAV){XWiki.WebDAV.davEdit('$davUrl')}; return false;">$msg.get('core.viewers.attachments.webdavEdit')</a>
            #end
      

      Result : When using URL rewriting, The DAV Edit attachement might not be generated because of the $attachmentUrl split

        Attachments

          Activity

            People

            • Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              oana.tabaranu Elena-Oana Florea
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: