Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-63756

A clean friendly url cause submitForm() js call fail on submit

    Details

      Description

      After optimizing a portlet's friendly URL mapping to remove all verbose URL parameters from an action request form's submit URL,I encountered following problem:
      The form will not able to be submitted at all. The first click on the submit button triggers javascript exception in browser's javascript console and subsequence click will not do anything since the buttons are disabled by javascript triggered by first click.
      Notice the bug can only be triggered when the action URL is FULLY optimized. An example of optimized friendly URL which would trigger the bug is like this:

      <aui:form action="http://localhost:8080/web/guest/home/-/dm/NOEl9juqtAuH/update/22706?p_auth=ngPdDepF" enctype="multipart/form-data" method="post" name="fm" onSubmit="event.preventDefault(); submitForm(event.target);">
      ...
      </aui:form>
      

      When the p_auth parameter (always generated by portal for an actionURL) happens to be the last parameter in the whole URL string, it will trigger the script error in
      /portal-6.2.x/portal-web/docroot/html/js/liferay/util.js, line 847

      				if (x >= 0) {
      					var y = action.indexOf('&', x);
      
      					if (y < 0) {
      						y = action.length();
      					}
      

      The action.length() method call is not supported by a javascript string object. Should directly access it's length property.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                3 years, 26 weeks, 4 days ago

                Packages

                Version Package