Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-17415

When editing properties of a content in Share, the GET request contains placeholder that doesn't get substituted

    Details

      Description

      When editing the metadata of a content in Share, the GET request url contains braces. This is an example of the GET request:

      GET /share/service/components/form?itemKind=node&itemId=workspace://SpacesStore/eac06a73-693b-4a16-aa83-6b84e32a4437&destination={destination}&mode=edit&submitType=json&formId=doclib-simple-metadata&showCancelButton=true&htmlid=template_x002e_documentlist_v2_x002e_repository_x0023_default-editDetails-alf-id44 HTTP/1.1

      Notice the "destination" value as part of the url.

      The use of braces is not RFC3986 compliant and moreover the expression "{destination}" is meant to be replaced in the javascript actions.js for a valid value.

      The following snippet of actions.js shows where url is generated:

      var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&formId={formId}&showCancelButton=true",
               {
                  itemKind: "node",
                  itemId: nodeRef,
                  mode: "edit",
                  submitType: "json",
                  formId: "doclib-simple-metadata"
               });

      The replacement for the expresion in braces "{destination}" is missing in the function substitute (1) and as a result is left over as part of the URL.

      Impact:

      The fact of having unencoded braces as part of the url violates the RFC 3986 (2) which states in section 2.1 that any character outside the allowed set must use the percent-encoding mechanism.

      In addition to that, Tomcat has released a patch which prevents the use of braces on the url in order to be RFC7230 (3) compliant. This causes Share to don't be able to edit the metadata of any content and to show an error in the browser instead (see screenshot attached). The patch can be found in version 7.0.52-1ubuntu0.8 which is part of the supported stack for Alfresco 5.0.x

      Steps to reproduce:

      1. On Ubuntu Linux 14.04 install tomcat version 7.0.52-1ubuntu0.8.
      2. Install Alfresco 5.0.x
      3. From the repository view (not the detailed view), try to edit the properties of any folder from the right menu.

      Expected behaviour:

      The edit medata form of the folder is shown.

      Actual behaviour:

      Share shows a Failure error:

      Could not load dialog template from '/share/service/components/form?itemKind=node&itemId=workspace://SpacesStore/f4739e32-57e1-4aee-93ca-c745f99889ab&destination={destination}&mode=edit&submitType=json&formId=doclib-simple-metadata&showCancelButton=true'.

      (1) http://yui.github.io/yui2/docs/yui_2.7.0/docs/YAHOO.lang.html
      (2) https://tools.ietf.org/html/rfc3986#section-2.1
      (3)https://tools.ietf.org/html/rfc7230#section-3.1.1

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs
                  Reporter:
                  folcina Francisco Olcina Grande
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 7 hours
                    7h

                      Structure Helper Panel