Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22141

Unescaped single quote prevents view layout from being displayed

    XMLWordPrintable

    Details

      Description

      1. use a select2widget in a layout
      2. in the creation layout, configure the widget like in widget1.png, widget2.png, widget3.png, widget4.png
      3. import the same configuration into view and edit layouts
      4. synchronized the project
      5. create 2 documents so that the myVals is filled in with 1 value containing a single quote
      6. create a 3rd document and fill in the multivalued attribute with the previously entered myVals values (not containing the single quote).
      7. save the document
      8. observe the document is correctly created and the value displayed is the one specified in the widget configuration field named "Id Property" (myVals)
      9. edit the same document and choose the value containing the single quote.
      10. observe the value is selected without any issue
      11. attempt to save the document
      12. the following stack is displayed:
        Failed to execute query: select * from Document where testdocument:myVals='apostruc'phe', Syntax error: Invalid token <phe> at offset 60
        
                         javax.servlet.ServletException: Failed to execute query:  select * from Document where testdocument:myVals='apostruc'phe', Syntax error: Invalid token <phe> at offset 60
        	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        

      Please note using a page provider is not a solution since there is no way to reference it in the studio view layout, so it ends up with the same issue.

        Attachments

        1. widget1.png
          widget1.png
          110 kB
        2. widget2.png
          widget2.png
          97 kB
        3. widget3.png
          widget3.png
          86 kB
        4. widget4.png
          widget4.png
          91 kB

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h