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

When CAPTCHA is enabled on forms, submitting any result throws a NullPointerException

    Details

    • Story Points:
      1
    • Fix Priority:
      4
    • Sprint:
      F&W Sprint 4

      Description

      Summary
      When using a form that has CAPTCHA verification enabled, any submission (whether a good submission or incorrect submission) results in a NullPointerException.

      Steps to Reproduce

      1. Product Menu > Liferay DXP (Site) > Content > Forms
      2. Create a new form with an arbitrary field like Paragraphs, then Save
      3. After saving the Form, click on the Options button on the top right corner, Enable CAPTCHA, Save the dialog, then Save Form.
      4. Click the link icon next to the + button, and copy the URL
      5. Open a new tab and paste the URL to access the form
      6. In the Text Verification, you can enter either the correct CAPTCHA response, or just any data

      Actual Result
      While the overall UI behavior is good – CAPTCHA is accepted (if correct) or CAPTCHA is rejected (if incorrect) – a NullPointerException is thrown in the console:

      2018-08-21 05:27:40.670 ERROR [http-nio-8080-exec-1][IncludeTag:128] Current URL /o/dynamic-data-mapping-form-context-provider/ generates exception: java.lang.NullPointerException
      java.lang.NullPointerException
      	at com.liferay.taglib.util.PositionTagSupport.getPositionValue(PositionTagSupport.java:82)
      	at com.liferay.taglib.util.PositionTagSupport.getPosition(PositionTagSupport.java:33)
      	at com.liferay.taglib.util.PositionTagSupport.isPositionInLine(PositionTagSupport.java:48)
      	at com.liferay.taglib.aui.ScriptTag.doEndTag(ScriptTag.java:143)
      	at org.apache.jsp.captcha.simplecaptcha_jsp._jspService(simplecaptcha_jsp:295)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:344)
      	at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:355)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:118)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)

      Expected Behavior
      The NPE should not be thrown if CAPTCHA is enabled.

      Reproduced in
      7.1.x private Commit: 815320372a34faa0ccd0ed1d4989af7d1502c5e6

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 43 weeks, 2 days ago

                  Packages

                  Version Package
                  Master