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

Importing fragment through CLI is using legacy API

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.2.X, Master
    • Fix Version/s: None
    • Component/s: Fragments Toolkit
    • Labels:
      None

      Description

      Environment

      $>node -v
      v11.15.0
      
      $> npm ls -g --depth=0
      /Users/jordi/.npm-packages/lib
      ├── generator-liferay-fragments@1.6.0
      ├── generator-liferay-js@2.18.2
      ├── generator-liferay-theme@9.5.0
      ├── gulp@4.0.2
      ├── liferay-npm-sdk-assistant@0.7.0
      ├── n@6.4.0
      ├── npm@6.14.2
      └── yo@3.1.1

      Issue
      Importing fragment through CLI is using legacy API

      Steps to reproduce

      1. Create a new fragment project
        yo liferay-fragments
        Sample Liferay Fragments
        No
        cd sample-liferay-fragments/
      1. Add a collection
        npm run add-collection
        JJ Collection
      1. Add a fragment
        npm run add-fragment
        Section 1
        Section
        jj-collection
      1. Build and zip the fragment
        npm run compress
        Yes
        liferay.com
        Guest

        Note that it successfully generates the zip file

      1. Import the fragment
        npm run import
      1. Note that it successfully imports the fragment but for some reason, the following error is displayed
        Importing project...
        
        Generating zip file
        
        build/liferay-fragments.zip file created
        Import them to your liferay-portal to start using them:
        https://dev.liferay.com/discover/portal/-/knowledge_base/7-1/exporting-and-importing-fragments#importing-collections
        Zip file not generated, using legacy APIs
        
        2 of 2 fragments were added successfully.
        
        ✔ Collection JJ Collection
          ✚ Fragment Component 1 added
          ✚ Fragment Section 1 added

         "Zip file not generated, using legacy APIs"

      NOTES
      Looks like it fails with the non-legacy way to import and falls back to legacy mode.
      https://github.com/liferay/generator-liferay-fragments/blob/master/generators/import/import.js#L52

      Actual results
      Uses legacy API to import

      Expected results
      Uses non-legacy API to import

      Reproduced in
      DXP 7.2 FP4

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            daniel.couso Daniel Couso
            Participants of an Issue:
            Recent user:
            Daniel Couso
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              34 weeks, 3 days ago

                Packages

                Version Package