TWCable / grabbit

Grabbit - Fast Content Sync tool for AEM/CQ
Apache License 2.0
125 stars 64 forks source link

Grabbit fails sync when node name contains '$' sign #213

Open dbugrimov opened 6 years ago

dbugrimov commented 6 years ago

Syncing DAM Assets I came across an issue when Grabbit throws an exception meeting '$' sign in a node name.

Code with issue: /src/main/groovy/com/twcable/grabbit/jcr/DefaultProtoNodeDecorator.groovy Line 58: createFrom(childNode, childNode.getName().replaceFirst(Pattern.quote(innerProtoNode.name), getName())).writeToJcr(session)

when getName() returns a node name with '$' sign in it, replaceFirst treats it as a capturing group reference in the replacement string and throws an exception

djessup commented 6 years ago

I too have run into this. I'd argue if a node has a valid JCR name it should be taken as-if and not interpreted unless an option explicitly says so.

ElmiraZhernova commented 5 years ago

Here is pull request , that fixes this issue https://github.com/TWCable/grabbit/pull/224