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

Dropdown lists lose data upon saving in Users and Organizations if they are the only ones modified

    Details

    • Story Points:
      4
    • Fix Priority:
      2
    • Similar Issues:
      Show 4 results 

      Description

      Reproduction steps:
      1. Go to Control Panel -> Users and Organizations -> Add -> Regular Organization
      2. Fill the Name, then Save.
      3. Click on Addresses and fill only the Country (US), the Region (Alabama, or any other) fields. Don't fill out the required Street 1 and City fields!
      4. After you Save, you get an error message "Street 1 and city are required fields. Postal code could be required in some countries.", and the Country and the Region fields are emptied, so I must reenter these data.

        Activity

        Hide
        Adam Nagy added a comment -

        Additionally there is a message:
        Your request completed successfully. I think upon saving the code runs to the request completed phase instead of the failure message, see below.

        Furthermore:
        If you fill any other fields there is an other error:
        Your request failed to complete.

        This is correct, however the screen ends up at the "Details" menu. Clicking again Addresses you can see another error message: "Please enter a valid street." (I would say this is a bug too because if you modify something else the error prevents you from saving and nothing indicating under which menu item the error occurred)

        ++ If you change Type, it is affected the same way as the Country and Region.

        If however there is any other field filled and the portal prints the error message then the values are stored.

        Summarizing: the issue affects the drop-down lists and only if there are no other fields filled in.

        Show
        Adam Nagy added a comment - Additionally there is a message: Your request completed successfully. I think upon saving the code runs to the request completed phase instead of the failure message, see below. Furthermore: If you fill any other fields there is an other error: Your request failed to complete. This is correct, however the screen ends up at the "Details" menu. Clicking again Addresses you can see another error message: "Please enter a valid street." (I would say this is a bug too because if you modify something else the error prevents you from saving and nothing indicating under which menu item the error occurred) ++ If you change Type, it is affected the same way as the Country and Region. If however there is any other field filled and the portal prints the error message then the values are stored. Summarizing: the issue affects the drop-down lists and only if there are no other fields filled in.
        Hide
        Adam Nagy added a comment -

        If Street 3 is filled in but nothing else.

        In class EditOrganizationAction

        In updateOrganization(

        OrganizationServiceUtil.updateOrganization(

        return getService().updateOrganization(..., addresses, ...)

        throws AddressStreetException

        If the address is filled in too, then the AddressCityException gets thrown properly

        When I use the drop down menu items to select values they can be found correctly in the addresses object which is passed to the above method.

        If however I only select one from the dropdowns:
        Country or Region or Type
        and leave the others blank the object stays empty
        And nothing gets thrown. The portal acts as if I haven't filled in anything.

        Object: List<Address> addresses = UsersAdminUtil.getAddresses(actionRequest);

        It seems that the actionRequest doesn't contain the values.

        Show
        Adam Nagy added a comment - If Street 3 is filled in but nothing else. In class EditOrganizationAction In updateOrganization( OrganizationServiceUtil.updateOrganization( return getService().updateOrganization(..., addresses, ...) throws AddressStreetException If the address is filled in too, then the AddressCityException gets thrown properly When I use the drop down menu items to select values they can be found correctly in the addresses object which is passed to the above method. If however I only select one from the dropdowns: Country or Region or Type and leave the others blank the object stays empty And nothing gets thrown. The portal acts as if I haven't filled in anything. Object: List<Address> addresses = UsersAdminUtil.getAddresses(actionRequest); It seems that the actionRequest doesn't contain the values.
        Hide
        Adam Nagy added a comment -

        Other testing:

        The same issue can be seen when using the dropdown of the "Phone Numbers" section.
        The "Email Address" section.
        The "Websites" Type section.
        The "Reminder Queries" section.

        The places where dropdown lists are placed.

        Show
        Adam Nagy added a comment - Other testing: The same issue can be seen when using the dropdown of the "Phone Numbers" section. The "Email Address" section. The "Websites" Type section. The "Reminder Queries" section. The places where dropdown lists are placed.
        Hide
        Daniel Javorszky added a comment -

        There are in fact two issues here:

        1 - Only changing the country (and the region), and then hitting save:
        In this case, the portal does not recognize that there was a change, and completes with a "success" message; the value of the selected country/region is lost.
        Reproduced on 6.2.x commit 25c4ca3ad345929c90863ed10a49fd61b8042533

        2 - Not specifying Street 1 and/or City, however adding something else (e.g. street2):
        In this case, the portal gives an error, but remembers the values (including the country and region). However, it redirects to the "Details" tab. I've found that if I modify the code to redirect to the tab where you hit save, the values get lost.

        Show
        Daniel Javorszky added a comment - There are in fact two issues here: 1 - Only changing the country (and the region), and then hitting save: In this case, the portal does not recognize that there was a change, and completes with a "success" message; the value of the selected country/region is lost. Reproduced on 6.2.x commit 25c4ca3ad345929c90863ed10a49fd61b8042533 2 - Not specifying Street 1 and/or City, however adding something else (e.g. street2): In this case, the portal gives an error, but remembers the values (including the country and region). However, it redirects to the "Details" tab. I've found that if I modify the code to redirect to the tab where you hit save, the values get lost.
        Hide
        Ginson Ren added a comment -

        PASSED Manual Testing following the steps in the description.

        Reproduced on:
        Tomcat 7.0 + MySQL 5. Portal master GIT ID: 5d5c2478dbe7e52eab647c2a94ca8d1f527123c6.

        After clicking save button, the Country and the Region fields are emptied.

        Fixed on:
        Tomcat 7.0 + MySQL 5. Portal master GIT ID: 8cbad49fb75d428f55e16202dcf52e4cde038bc0.

        After clicking save button, the Country and the Region fields will be remained.

        Show
        Ginson Ren added a comment - PASSED Manual Testing following the steps in the description. Reproduced on: Tomcat 7.0 + MySQL 5. Portal master GIT ID: 5d5c2478dbe7e52eab647c2a94ca8d1f527123c6. After clicking save button, the Country and the Region fields are emptied. Fixed on: Tomcat 7.0 + MySQL 5. Portal master GIT ID: 8cbad49fb75d428f55e16202dcf52e4cde038bc0. After clicking save button, the Country and the Region fields will be remained.
        Hide
        Ginson Ren added a comment -

        I also found the page will redirect to the "Details" tab if I filled some invalid message. But if I fill correct messages and save them, the page will redirect to the current tab. Since Daniel's comment, I am not sure if this behavior is expected, and I am emailing developer for confirm.

        Show
        Ginson Ren added a comment - I also found the page will redirect to the "Details" tab if I filled some invalid message. But if I fill correct messages and save them, the page will redirect to the current tab. Since Daniel's comment, I am not sure if this behavior is expected, and I am emailing developer for confirm.
        Hide
        Ginson Ren added a comment - - edited

        No Longer Reproducible on:
        Tomcat 7.0 + MySQL 5. Portal master GIT ID: 5ed5f06618bc59669bd36269417b8b47e7cd7e84.

        When I fill invalid information and click save, there will be a warning message and the page will stay in current tab.

        Note: This ticket can be closed, thanks.

        Show
        Ginson Ren added a comment - - edited No Longer Reproducible on: Tomcat 7.0 + MySQL 5. Portal master GIT ID: 5ed5f06618bc59669bd36269417b8b47e7cd7e84. When I fill invalid information and click save, there will be a warning message and the page will stay in current tab. Note: This ticket can be closed, thanks.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 27 weeks, 3 days ago

              Development

                Structure Helper Panel