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

Geolocation custom fields don't work properly if they include non-alphanumeric characters in the field name



      If a Geolocation Custom Field contains a non-alphanumeric character in the field name, it will not be processed correctly on the backend. This is due to changes that were made in LPS-140467. The changes made in LPS-140467 cause the field name set in the request to not match up with the field's actual name, which leads to the backend being unable to detect the value that the user input into the custom field.

      Steps to Reproduce
      1. Start up Liferay and log in as the admin user.
      2. Navigate to [Global Menu] > Control Panel > Custom Fields > User > + > Geolocation to add a custom Geolocation field.
      3. In the Name text box, enter "Test Field" (be sure to include the space character in the name).
      4. Click Save.
      5. Navigate to [Global Menu] > Control Panel > Users and Organizations > + to add a new User.
      6. Fill out the required information. For the Test Field map at the bottom of the screen, move the map pin somewhere other than its starting location (note: you may need to grant permission to your browser to use your location first).
      7. Save the user.
      8. Navigate back to [Global Menu] > Control Panel > Users and Organizations.
      Expected Result: The new user would have saved with no errors in the logs, and would be visible on the Users and Organizations > Users page.
      Actual Result: The new user is not visible on the Users and Organizations > Users page, and the following error appeared in the logs upon saving the user:

      2022-02-04 00:16:21.616 ERROR [http-nio-8080-exec-10][BulkDocumentRequestExecutorImpl:57] failure in bulk execution:_[1]: index [liferay-20099], type [LiferayDocumentType], id [com.liferay.portal.kernel.model.User_PORTLET_42811], message [ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse field [expando__keyword__custom_fields__img Src x Onerror prompt (1)_geolocation] of type [geo_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse_exception, reason=field [lat] missing]];] [Sanitized]
      2022-02-04 00:16:21.618 ERROR [http-nio-8080-exec-10][ElasticsearchIndexWriter:361] Update failed




            eric.park Eric Park
            michael.bowerman Michael Bowerman
            Marta Elicegui Marta Elicegui
            Michael Bowerman Michael Bowerman
            0 Vote for this issue
            1 Start watching this issue


              34 weeks, 3 days ago


                Version Package
                7.2.10 DXP FP17
       DXP SP6
       CE GA12
                7.4.13 DXP U8