You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Eric Norman (Jira)" <ji...@apache.org> on 2021/01/12 23:52:00 UTC

[jira] [Comment Edited] (SLING-10020) importing date property using sling post servlet fails

    [ https://issues.apache.org/jira/browse/SLING-10020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263772#comment-17263772 ] 

Eric Norman edited comment on SLING-10020 at 1/12/21, 11:51 PM:
----------------------------------------------------------------

FYI: The change history shows that the date parsing was changed to the ISO8601 format for the SLING-7590 fix.

Seems like a workaround for the "Legacy ECMA date format" may still be needed in the various content parsers since the DefaultGetServlet still has "ecmaSupport" set as true by default?

Alternately, you may consider changing the configuration of the DefaultGetServlet in your deployment to turn off the "ecmaSupport" flag which should get you ISO8601 formatted dates in the json output which may make it less confusing.

 


was (Author: enorman):
FYI: The change history shows that the date parsing was changed to the ISO8601 format for the SLING-7590 fix

> importing date property using sling post servlet fails
> ------------------------------------------------------
>
>                 Key: SLING-10020
>                 URL: https://issues.apache.org/jira/browse/SLING-10020
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: JCR ContentLoader 2.2.4, JCR ContentLoader 2.4.0, Servlets Post 2.3.26
>         Environment: AEM 6.5.6
>            Reporter: Johannes Das
>            Priority: Minor
>
> The issue happens when the import operation of the sling post servlet(2.3.26) is used:
> An imported data-structure contains a date like "2018-09-18T22:00:00.000+0000" results in a nullpointer beeing thrown without any clear logging.
> This happens because org.apache.sling.jcr.contentloader.internal.readers.JsonReader(2.2.6) accepts it as a date(line 280) and in org.apache.sling.jcr.contentloader.internal.DefaultContentCreator(2.2.6)  (line 309) it tries to parse the date-string into a calendar object which fails bacause it expects a string like "2018-09-18T22:00:00.000+00:00" or "2018-09-18T22:00:00.000Z".
> should there be a fallback like in version 2.2.4? This is still present in version 2.4.0.
> I also noticed org.apache.sling.jcr.contentloader.internal.readers.JsonReader(2.2.6) doesnt accept "2018-09-18T22:00:00.000Z"  as a date string. Should the regex in org.apache.sling.jcr.contentloader.internal.readers.JsonReader be adapted to also allow strings like "2018-09-18T22:00:00.000Z"? The regex is still the same in version 2.4.0.
> Should the logging be improved?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)