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

liferay-ui:flash mishandles flashVars parameter and does not use it

    Details

      Description

      I have a portlet that uses the liferay-ui:flash taglib but I noticed that the flashVars parameter was being duplicated in the generated HTML. In other words, there were two "flashVars" attributes. More precisely, one was "flashvars" (lowercase V) with my values and the other was "flashVars" with Liferay-generated values. Here's my usage:

      view.jsp
      <c:set var="isIE" value="${fn:contains(header['User-Agent'],'MSIE')}" />
      <liferay-ui:flash play="true" loop="false" quality="high" allowScriptAccess="sameDomain" allowFullScreen="true" height="800px" movie="movie.swf" wmode="opaque" flashvars="isIE=${isIE}&foo=FOO&bar=BAR" />
      

      I noticed that in html/taglib/ui/flash/page.jsp for the flash taglib, it seems to incorrectly call the AlloyUI SWF constructor. The "flashvars" variable was being set within fixedAttributes as a string when in fact, it should be its own parameter, parallel to fixedAttributes. Furthermore, it should be an object, not a string.

      Here's the before and after of page.jsp with irrelevant bits removed:

      html/taglib/ui/flash/page.jsp - Original
      new A.SWF(
      		{
      			boundingBox: '#<%= randomNamespace %>flashcontent',
      			fixedAttributes: {
      				// [...]
      				bgcolor: '<%= bgcolor %>',
      				devicefont: '<%= devicefont %>',
      				flashvars: '<%= flashvars %>',
      				// [...]
      			},
      			// [...]
      
      html/taglib/ui/flash/page.jsp - Fixed
      // Translate flashVars string into object.
      var flashVarsObj = {};
      var flashvars = '<%= flashvars %>';
      var splitFlashVars = flashvars.split('&');
      		
      for (var i = 0, n = splitFlashVars.length; i < n; i++) {
      	var splitVar = splitFlashVars[i].split('=');
      		
      	flashVarsObj[splitVar[0]] = splitVar[1];
      }
      
      new A.SWF(
      		{
      			boundingBox: '#<%= randomNamespace %>flashcontent',
      			fixedAttributes: {
      				// [...]
      				bgcolor: '<%= bgcolor %>',
      				devicefont: '<%= devicefont %>',
      				// [...]
      			},
      			flashVars: flashVarsObj,
      			// [...]
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              zsolt.szabo Zsolt Szabo (Inactive)
              Reporter:
              lyamamoto Leo Yamamoto (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 27 weeks, 3 days ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.0 CE GA1
                  --Sprint 11/12
                  6.2.0 CE M2