Uploaded image for project: '{RETIRED} XWiki Enterprise'
  1. {RETIRED} XWiki Enterprise
  2. XE-1156

XWiki.AttachmentSelector does not work when Class has multiple Sheets bound

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 4.0
    • Labels:
      None
    • Environment:
      XWiki 3.5 with default XAR imported
    • keywords:
      Sheet AttachmentSelector xaction upload
    • Similar issues:

      Description

      With two Sheets bound to a class to display separate view and edit page layouts the AttachmentSelector fails to set the uploaded file.
      Sheet 1 has the 'edit' property set for the XWiki.SheetDescriptorClass object.
      Sheet 2 has the 'view' property set for the XWiki.SheetDescriptorClass object.

      It sends a redirect with a docAction=inline which doesn't display the correct layout.

      eg:
      http://localhost/wiki/bin/get/XWiki/AttachmentSelector?xaction=postUpload&docAction=inline&docname=PhotoLibrary.Albion&fieldname=PhotoLibrary.PhotoLibraryClass_0_planimage&form_token=7YE3OTmA62D8vFHztHrJ3Q

      If I remove the 'edit' XWiki.SheetDescriptorClass object then the attachment selector works, but the correct 'view' Sheet is not used.

      I worked around the default XAR import by doing the following:

      I checked in the xaction=postUpload section of the XWiki.AttachmentSelector macro if the docAction was 'inline' and I changed it to 'edit' instead.
      This then seems to work fine with both Sheets and the XWiki.SheetDescriptorClass set for both as appropriate.

        Attachments

          Activity

            People

            Assignee:
            mflorea Marius Dumitru Florea
            Reporter:
            jamiem Jamie Maher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: