liferay-portal icon indicating copy to clipboard operation
liferay-portal copied to clipboard

[TS] LPS-188466 importing fragments with global scoped sitenavmenu fails

Open GaborKomaromi opened this issue 1 year ago • 2 comments

Hi Team,

Could you please review this pull request? https://liferay.atlassian.net/browse/LPS-188466 Thank you!


Reproduction Steps:

  1. Go to the Global Site --> Site Builder --> Navigation menus and add a navigation menu and add to it a URL element (http://www.google.com/)
  2. Go to Control Panel --> Sites --> Sites and create a blank site
  3. On the Site, go to Design --> Fragments and add a fragment set then create a basic fragment and change its configuration by pasting the following:
{

  "fieldSets": [

    {

      "label": "",

      "fields": [

        {

          "name": "source",

          "description": "",

          "label": "Source",

          "type": "navigationMenuSelector"

        }

      ]

    },

    {

      "configurationRole": "style",

      "label": "",

      "fields": [

        {

          "name": "hoveredItemColor",

          "description": "",

          "label": "Couleur de lélément survolé",

          "type": "colorPicker"

        },

        {

          "name": "selectedItemColor",

          "description": "",

          "label": "Couleur de lélément sélectionné",

          "type": "colorPicker"

        }

      ]

    }

  ]

}

  1. Go to Site Builder --> Pages and add a content (blank) page and add the created fragment to it, then click the fragment (it is so thin to be noticed). Change the “Pages Hierarchy” source by selecting the created navigation menu and then click on “Select this level”, then publish the page.

  2. Go to Publishing --> Export and export the Site and download the LAR.

  3. Go to Publishing --> Import and import the LAR into the same site.

Expected Result:* The import is successful with no issues. Actual Result: The import fails with a UI error:

An unexpected error occurred with the publish process. Please check your portal and publishing configuration.
java.lang.UnsupportedOperationException

Solution: If there's a reference from a regular site to the global (or basically any other) site, they will be exported as "missing reference". This was not handled in case of the SiteNavigationMenus, so I implemented doImportMissingReference method to do so.

GaborKomaromi avatar Jun 22 '23 15:06 GaborKomaromi

Hey @GaborKomaromi,

You should send this one to @liferay-echo user.

ealonso avatar Jun 27 '23 08:06 ealonso

moved this PR to https://github.com/liferay-echo/liferay-portal/pull/12601

gergelyszalay avatar Jun 27 '23 11:06 gergelyszalay