[ 
https://issues.apache.org/jira/browse/OFBIZ-9770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aditya Sharma updated OFBIZ-9770:
---------------------------------
    Attachment: OFBIZ-9770.patch

Problem:
GlobalActions screen of themes/common/widget/CommonScreens.xml is loaded twice.
1. Included in GlobalDecorator screen of themes/common/widget/CommonScreens.xml


{code:java}
<include-screen name="GlobalActions" />
{code}


2. Included in GlobalActions screen of framework/common/widget/CommonScreens.xml

{code:java}
<include-screen name="GlobalActions" 
location="${groovy:commonScreenLocations.GlobalActions?commonScreenLocations.GlobalActions:commonDecoratorLocation}"/>
{code}

where commonScreenLocations variable is initialized in MinimalActions screen


{code:java}
<set field="commonDecoratorLocation" 
from-field="layoutSettings.VT_COMMON_DECO_LOC" 
default-value="component://common-theme/widget/CommonScreens.xml" 
global="true"/>
{code}

 and layoutSettings.VT_COMMON_DECO_LOC is always empty for all the themes.

Solution:

I removed the first instance i.e. from GlobalDecorator.

Steps to verify:
All the files (js, css etc) included in this screen are still available.

Though if there is some other way to verify, suggestions are most welcomed :)

If this works fine I will review header.ftl where such duplicity is handled for 
JS files with some logic using set  & it can be removed.


{code:java}
<#if layoutSettings.javaScripts?has_content>
      <#--layoutSettings.javaScripts is a list of java scripts. -->
      <#-- use a Set to make sure each javascript is declared only once, but 
iterate the list to maintain the correct order -->
      <#assign javaScriptsSet = 
Static["org.apache.ofbiz.base.util.UtilMisc"].toSet(layoutSettings.javaScripts)/>
      <#list layoutSettings.javaScripts as javaScript>
        <#if javaScriptsSet.contains(javaScript)>
          <#assign nothing = javaScriptsSet.remove(javaScript)/>
          <script 
src="<@ofbizContentUrl>${StringUtil.wrapString(javaScript)}</@ofbizContentUrl>" 
type="text/javascript"></script>
        </#if>
      </#list>
    </#if>
{code}

 

> CSS files defined through layoutSettings in GlobalActions are loaded twice
> --------------------------------------------------------------------------
>
>                 Key: OFBIZ-9770
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9770
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL APPLICATIONS
>    Affects Versions: Trunk
>            Reporter: Aditya Sharma
>            Assignee: Aditya Sharma
>         Attachments: OFBIZ-9770.patch, screenshot-1.png
>
>
> CSS files added in GlobalActions screen of CommonScreens.xml are loaded twice.
> Css file jquery.jgrowl.min.css is loaded twice.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to