Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-21887

User is not redirected to the previous page after the Save button click if the form contains a date property and the user clicks in the calendar icon when filling the properties

    Details

    • Security Severity:
      None

      Description

      Steps to reproduce:
      Configure Share to show a date property in the edit-metadata form;
      Fill in all the properties normally, but for the date property, click the calendar icon to show the calendar and pick any date;
      Click the Save button.

      Expected behaviour:
      User got redirected to the previews page, like document library or the node-details form.

      Observed behaviour:
      Nothing happens, and the user does not know if the change was saved or not, and most of the times, users will try to click again.

      What caused the problem:
      Once the user clicks in the calendar link, the URL is appended with a # character, and that makes the latest page, the one without the #, the previous one, to where the user is redirected.

      This problem was caused by the following commit: https://github.com/Alfresco/share/commit/050be46165463f8d1625e72c5c13260e034da059

      This is related with https://issues.alfresco.com/jira/browse/SHA-126

        Attachments

          Issue Links

            Activity

            Hide
            kroast Kevin Roast added a comment -

            Due to a problem with the build (not related to this issue!) the Testing Verification did not happen yesterday so the fix was not merged. I will try and nudge it along today. It will appear in the svn mirror.

            I will ask about the github mirror, as it does not seem to have been updated at all for a long time!

            Show
            kroast Kevin Roast added a comment - Due to a problem with the build (not related to this issue!) the Testing Verification did not happen yesterday so the fix was not merged. I will try and nudge it along today. It will appear in the svn mirror. I will ask about the github mirror, as it does not seem to have been updated at all for a long time!
            Hide
            kroast Kevin Roast added a comment -
            Index: web-framework-commons/src/main/webapp/js/alfresco.js
            ===================================================================
            --- web-framework-commons/src/main/webapp/js/alfresco.js	(revision 136621)
            +++ web-framework-commons/src/main/webapp/js/alfresco.js	(revision 136622)
            @@ -11293,7 +11293,8 @@
                                   * Since everything after the "#" isn't included in the value of document.referrer we must use
                                   * history.go(-1) so the page can restore to its previous ajax state.
                                   */
            -                     history.go(-1);
            +                     var back = (document.location.href.indexOf('#') === -1) ? -1 : -2;
            +                     history.go(back);
                               }
                               else if (history.state && history.state.previous_url && this.isCromeRedirectToTheSamePage(document.referrer))
                               {
            Index: web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl
            ===================================================================
            --- web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl	(revision 136621)
            +++ web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl	(revision 136622)
            @@ -68,7 +68,7 @@
                      <input id="${controlId}-date" name="-" type="text" class="date-entry" <#if field.description??>title="${field.description}"</#if> <#if disabled>disabled="true"<#else>tabindex="0"</#if> />
                   
                      <#if disabled == false>
            -            <a id="${controlId}-icon" href="#"><img src="${url.context}/res/components/form/images/calendar.png" class="datepicker-icon" tabindex="0"/></a>
            +            <a id="${controlId}-icon" tabindex="0" href="#"><img src="${url.context}/res/components/form/images/calendar.png" class="datepicker-icon"/></a>
                      </#if>
                   
                      <div id="${controlId}" class="datepicker"></div>
            

            Is the diff from the fix revision.

            Show
            kroast Kevin Roast added a comment - Index: web-framework-commons/src/main/webapp/js/alfresco.js =================================================================== --- web-framework-commons/src/main/webapp/js/alfresco.js (revision 136621) +++ web-framework-commons/src/main/webapp/js/alfresco.js (revision 136622) @@ -11293,7 +11293,8 @@ * Since everything after the "#" isn't included in the value of document.referrer we must use * history.go(-1) so the page can restore to its previous ajax state. */ - history.go(-1); + var back = (document.location.href.indexOf('#') === -1) ? -1 : -2; + history.go(back); } else if (history.state && history.state.previous_url && this .isCromeRedirectToTheSamePage(document.referrer)) { Index: web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl =================================================================== --- web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl (revision 136621) +++ web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls/date.ftl (revision 136622) @@ -68,7 +68,7 @@ <input id= "${controlId}-date" name= "-" type= "text" class= "date-entry" <# if field.description??>title= "${field.description}" </# if > <# if disabled>disabled= " true " <# else >tabindex= "0" </# if > /> <# if disabled == false > - <a id= "${controlId}-icon" href= "#" ><img src= "${url.context}/res/components/form/images/calendar.png" class= "datepicker-icon" tabindex= "0" /></a> + <a id= "${controlId}-icon" tabindex= "0" href= "#" ><img src= "${url.context}/res/components/form/images/calendar.png" class= "datepicker-icon" /></a> </# if > <div id= "${controlId}" class= "datepicker" ></div> Is the diff from the fix revision.
            Hide
            douglascrp Douglas Cassiano Rodrigues Paes added a comment -

            Thank you @kroast (I still couldn't understand how to mention someone in the comments )

            Show
            douglascrp Douglas Cassiano Rodrigues Paes added a comment - Thank you @kroast (I still couldn't understand how to mention someone in the comments )
            Hide
            kroast Kevin Roast added a comment -

            In HEAD now revision r136658

            Show
            kroast Kevin Roast added a comment - In HEAD now revision r136658
            Show
            kroast Kevin Roast added a comment - http://alf-community-nightly.s3-website-eu-west-1.amazonaws.com/

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                douglascrp Douglas Cassiano Rodrigues Paes
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

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