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

When migrating from 6.1.0 to 6.1.1 scopes aren't updated in Asset Publisher Portlet Preferences

    Details

      Description

      As stated in public forums http://www.liferay.com/community/forums/-/message_boards/message/15585616, when migrating from 6.1.0 to 6.1.1 doesn't update scopes and Asset Publisher doesn't show Assets because it doesn't find them.

      What I can see is that in LR610 Scope looks like this

      • <name>defaultScope</name><value>10180</value>
      • <name>scopeIds</name><value>Group_10180</value>

      and in LR611 like this (after assignining manually the scope)

      • <name>defaultScope</name><value>Group_default</value>
      • <name>scopeIds</name><value>Group_default</value>

      I upgraded again and changed in portlet preferences:

      • <name>defaultScope</name><value>10180</value>
      • <name>scopeIds</name><value>Group_10180</value>

      by

      • <name>defaultScope</name><value>Group_10180</value>
      • <name>scopeIds</name><value>Group_10180</value>

      and it worked...

      So Henry K developed a hook that solves it by adding this lines to Asset Publisher as a Hook:

      if (Validator.isNotNull(portletResource)) {
      preferences = PortletPreferencesFactoryUtil.getPortletSetup(request, portletResource);
      }

      Map map = preferences.getMap();
      Iterator itr=map.entrySet().iterator();
      while (itr.hasNext()){
      Map.Entry entry = (Map.Entry)itr.next();
      try{
      System.out.println(entry.getKey() + ":" + Arrays.toString((String[])entry.getValue()));
      }catch(Exception e){
      System.out.println(entry.getKey() + ":" + Arrays.toString((long[])entry.getValue()));
      }

      if(entry.getKey().equals("defaultScope")){
      String[] val = (String[])entry.getValue();
      for(String s: val){
      if(!s.startsWith("Group_")){
      String newVal = "Group_" + s;
      preferences.setValue("defaultScope",newVal);
      }
      }
      }
      }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 9 weeks ago

                Packages

                Version Package