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

Layout typeSettings are stored inconsistently in the database for portlets

    Details

      Description

      DESCRIPTION
      Customer is trying to write custom code based on the type settings field for the Layout table, but they noticed that the type settings are being stored inconsistently for portlets.

      When adding a portlet to a column, the portlet ids are stored in comma separated form for each column, without a trailing comma. However, after a portlet is deleted, a trailing comma is added.

      This is proving to be an issue for their developers, as they have multiple columns, and are not sure whether to code for a trailing comma, or not.
      STEPS TO REPRODUCE
      1) Create a page with default 2 30/70 column layout.
      2) Add 3 portlets to each column on the page. Look at the type settings column in the database for that layout and notice that the portlets are comma separated, but do not have a trailing comma.
      3) Delete one of the portlets in column 1. Look at the type settings column, and notice that there are now trailing commas.
      4) Add a portlet to column 1. Notice that there is now no trailing comma for the column-1 ids.
      EXPECTED RESULTS
      Consistent behavior of commas/trailing commas after removing/adding portlets.
      ACTUAL RESULTS

      after creating the page and adding 3 portlets to each column:
      column-1=com_liferay_site_navigation_menu_web_portlet_SiteNavigationMenuPortlet_INSTANCE_ngtY4ZNSFZTM,com_liferay_document_library_web_portlet_DLPortlet_INSTANCE_K318iuf3PxKC,com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_X5mGvopilnsP column-2=com_liferay_wiki_navigation_web_portlet_WikiNavigationPageMenuPortlet_INSTANCE_V03Xe9QaGAPd,com_liferay_wiki_navigation_web_portlet_WikiNavigationTreeMenuPortlet_INSTANCE_CcbKBq3a95WB,com_liferay_wiki_web_portlet_WikiDisplayPortlet_INSTANCE_o3BLMC6mylx0 layout-template-id=2_columns_ii 
      
      
      
      after removing a portlet from column 1:
      column-1=com_liferay_document_library_web_portlet_DLPortlet_INSTANCE_K318iuf3PxKC,com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_X5mGvopilnsP, column-2=com_liferay_wiki_navigation_web_portlet_WikiNavigationPageMenuPortlet_INSTANCE_V03Xe9QaGAPd,com_liferay_wiki_navigation_web_portlet_WikiNavigationTreeMenuPortlet_INSTANCE_CcbKBq3a95WB,com_liferay_wiki_web_portlet_WikiDisplayPortlet_INSTANCE_o3BLMC6mylx0, layout-template-id=2_columns_ii 
      
      
      after adding a portlet to column 1:
      column-1=com_liferay_bookmarks_web_portlet_BookmarksPortlet,com_liferay_document_library_web_portlet_DLPortlet_INSTANCE_K318iuf3PxKC,com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_X5mGvopilnsP column-2=com_liferay_wiki_navigation_web_portlet_WikiNavigationPageMenuPortlet_INSTANCE_V03Xe9QaGAPd,com_liferay_wiki_navigation_web_portlet_WikiNavigationTreeMenuPortlet_INSTANCE_CcbKBq3a95WB,com_liferay_wiki_web_portlet_WikiDisplayPortlet_INSTANCE_o3BLMC6mylx0, layout-template-id=2_columns_ii 

      BRANCH
      Reproduced
      824de1dd96c48cc885421b59221534d72b4068eb
      MASTER
      Can't reproduce in Master (build fails
      BUILD FAILED
      /liferay-portal-ee/build.xml:282: The following error occurred while executing this line:
      /liferay-portal-ee/build-common.xml:663: exec returned: 1)
      commit 538c43b732677d509eb023555ab0e474af754612

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 27 weeks ago

                Packages

                Version Package
                7.0.0 DXP FP9
                7.0.0 DXP SP2
                7.0.3 CE GA4
                7.1.X
                Master