core icon indicating copy to clipboard operation
core copied to clipboard

[Push Publishing] Lookup of unique contents with special characters on their fields' values fail

Open joseorsini opened this issue 8 years ago • 3 comments

Current Behavior

Upon lookup of unique contents once they're pushed, any content with special character/spaces on its unique fields' values will fail, making the whole bundle to fail.

Possible Solution

Escape properly all special characters, and wrap the field's value under double quotes if it has spaces on its value.

Known Workarounds

None.

Steps to Reproduce (for bugs)

  1. Create a content type called "Test".
  2. Add a "Title" text field. This one MUST be indexed, user searchable AND unique.
  3. Create a content called "Test: This is a test".
  4. Push it to another environment.

Stacktrace:

https://gist.github.com/joseorsini/6aa5dd505fe8c45ca2897dbae013e99c

As the Gist shows above, the generated query that attempts to look for unique contents is

+structurename:medicalpolicy +languageid:1 +(medicalpolicy.title:telehealth: real-time interactive telemedicine services )

Which has spaces and special characters un-escaped. Original content title is "Telehealth: Real-time Interactive Telemedicine Services" and belongs to a content type called "Medical Policy".

Context

Reported by customer: https://dotcms.zendesk.com/agent/tickets/94957

Your Environment

  • dotCMS version used: 4.2.2.
  • Browser Name and version: Any Browser.
  • Operating System and version: Any OS.
  • Application Server and version: Any supported application server.
  • Java Brand and version: Any Java version.
  • Database and version: Any DB.
  • Application module (if apply): N/A.

joseorsini avatar Jan 12 '18 17:01 joseorsini

PR EE: https://github.com/dotCMS/enterprise-2.x/pull/575

joseorsini avatar Jan 12 '18 18:01 joseorsini

Passed QA.

MacOS 10.10.10 / Postgres 9.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Feb 02 '18 19:02 shaydotcms

Failed QA Still getting same error in logs when pushing content called "Test: This is a test" https://gist.github.com/shaydotcms/d9ec7a046e1731a5ef66447c8ba0a00a

shaydotcms avatar Feb 14 '18 00:02 shaydotcms