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

ReactJS Portlet configuration could not stored in DB

    Details

    • Type: Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 7.4.1 CE GA2, Master
    • Fix Version/s: None
    • Labels:
      None
    • Fix Priority:
      3

      Description

      Requirement:
      generator-liferay-js installed

      Step-by-Step:

      1. Using Liferay Generator prepare a react widget named my-testing-portlet (later on you can replace the directories src, assets and features with the ones from the attached my-testing-portlet.zip ).
      2. After replacing the directories deploy your react-widget bundle
      3. In portal, go to Site builder --> Pages and add a widget page
      4. Add My Testing Portlet to the page and go to Configuration
      5. In Setup, change the value of 'favourite drink'
      6. Save

      Actual result:
      TypeError: Cannot read property 'get' of undefined appears in the console and the value is not being saved in portletpreferencevalue table in DB.

      Expected:
      Value should be possible to change on the screen and stored in the portletpreferencevalue table.

      Environment: localhost
      Branch: master
      Bundle: Liferay EE
      Database: MySQL 5.7
      Last Commit: e5c990ea1b4b0be505332a28b101ec29cb9b6141

      Evidence:

      Browsers:

      • Chrome Latest

      Notes: It is possible to store the value of the Setup by going to the Sharing tab first. When again on Setup tab the value is being saved correctly both on the screen and in the DB table.

      More info:
      We have some ReactJS portlets which are generated with the 'generator-liferay-js' and our portlets has custom configurations.
      In Liferay 7.3.7-GA8 the configurations are saved without any problems in database (postgres 11).
      But, in Liferay 7.4.1 the configurations could not be persisted (postgres 12).
      Existing configurations of a ReactJS Portlet could be loaded from DB.

      If we try to save the configuration (in Liferays page editor) the configuration modal calls the '/o/dynamic-data-mapping-form-context-provider' endpoint. The Response has a HTTP 200 status code. But in the developer tools of the browser we get an error with the message: "TypeError: Cannot read property 'get' of undefined".

      If we generate a new 'testing-like' portlet by the 'generator-liferay-js' with sample code (it contains sample configuration) and deploy this portlet into Liferay 7.4.1, we are not able to save the configuration.

      Versions we use:

      • 'generator-liferay-js' --> latest
      • 'liferay-npm-bundler' -->  '2.26.0'
      • 'liferay-npm-build-support' -->  '2.26.0'
      • MANIFEST.MF: osgi.extender;filter:="(&(osgi.extender=liferay.frontend.js.portlet)(version>=1.1.0))"

       

      Steps to reproduce:

      1. Create a React Widget by 'generator-liferay-js' with sample code
      2. Run 'npm run build' for the portlet
      3. Deploy Portlet to Liferay 7.4.1
      4. Go into the  page editor and add the deployed portlet into your page
      5. Open the configuration of the portlet and change the configuration
      6. Click the save button

       

       

        Attachments

          Activity

            People

            Assignee:
            magdalena.jedraszak Magdalena Jedraszak
            Reporter:
            sascha.hofrichter Sascha Hofrichter
            Participants of an Issue:
            Recent user:
            Magdalena Jedraszak
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              4 weeks, 2 days ago

                Packages

                Version Package