enonic / app-formbuilder

Apache License 2.0
2 stars 7 forks source link

App crashes when generating reports via widget #5

Closed Bellfalasch closed 5 years ago

Bellfalasch commented 5 years ago

When setting up the app to store form signups as content, and you store 1 form post, and then use the widget to generate a report out of this, it will crash on malformed dates. Looks like some string manipulation went bad in the error message. It should have been 20190206- to be correct ISO date. Here's the log, and a screenshot from the widget before I click submit (that's when the error occurs).

Caused by: com.enonic.xp.query.QueryException: Value of type [java.lang.String] cannot be converted to [DateTime]: Text '2019201902-062019-02-06T00:00:00Z' could not be parsed at index 0
line 1, column 131
    at com.enonic.xp.query.parser.QueryParser.doParseConstraint(QueryParser.java:57)
    at com.enonic.xp.query.parser.QueryParser.parseCostraintExpression(QueryParser.java:77)
    at com.enonic.xp.lib.node.AbstractFindNodesQueryHandler.createNodeQuery(AbstractFindNodesQueryHandler.java:53)
    at com.enonic.xp.lib.node.FindNodesByQueryHandler.execute(FindNodesByQueryHandler.java:24)
    at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:101)
    at com.enonic.xp.lib.node.NodeHandler.execute(NodeHandler.java:175)
    at com.enonic.xp.lib.node.NodeHandler.query(NodeHandler.java:105)
    at jdk.nashorn.internal.scripts.Script$Recompilation$547$8730A$node.L:1#query(com.enonic.app.formbuilder:/site/lib/xp/node.js:259)
    at jdk.nashorn.internal.scripts.Script$Recompilation$553$1820A$formreport.L:1#handleGet(com.enonic.app.formbuilder:/services/formreport/formreport.js:92)
    at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639)
    at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
    at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
    at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117)
    at com.enonic.xp.script.impl.value.FunctionScriptValue.call(FunctionScriptValue.java:36)
    ... 108 common frames omitted

screenshot 2019-02-06 at 13 30 13

hjelmevold commented 5 years ago

@Bellfalasch what browser was used? The problem could be related to how one browser/version handles date inputs.

Bellfalasch commented 5 years ago

Firefox developer edition. On the screenshot you can see it displays today's date as 02 / 06 / 2019. Haven't tried in other browsers.

hjelmevold commented 5 years ago

I'm unable to reproduce this, using the following steps:

Do you get the same error in other browsers? Have you tried deactivating browser add-ons/extensions?

Bellfalasch commented 5 years ago

Hmm, I'm on version 65 of Firefox Dev edition, will upgrade and test again.

alansemenov commented 5 years ago

@Bellfalasch any news on this one?

Bellfalasch commented 5 years ago

If Bjørnar cannot reproduce we'll just close the issue, I won't have time to look into it before my leave.