PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-5450

Hook values for string arrays are overwritten instead of combined

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.1.2, 5.2.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Branch Version/s:
      5.2.x, 5.1.x
    • Backported to Branch:
      Committed
    • Similar Issues:
      Show 5 results 

      Description

      "layout.static.portlets.all" is an example of a string array (ie comma delimited list of entries) that is customizable from a Hook.

      But hooks should play safely with each other by adding onto the string array instead of overwriting each other.

      Suppose you have test1-hook that has values "hello,world"

      Suppose you have test2-hook that has values "alpha,beta"

      Suppose the portal has a default value of "1_WAR_chatportlet"

      The final value used in PropsValues.LAYOUT_STATIC_PORTLETS_ALL should resolve to:

      1_WAR_chatportlet,hello,world,alpha,beta

      Before the fix, it would either be:

      "hello,world" or "alpha,beta" with no guarantee.

      The order is still not guaranteed, but the values are now guaranteed to be merged.

        Activity

          People

          • Assignee:
            SE Support
            Reporter:
            Brian Chan
            Recent user:
            Randy Zhu
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 32 weeks, 3 days ago

              Development

                Structure Helper Panel