grabbit icon indicating copy to clipboard operation
grabbit copied to clipboard

Grabbit fails sync when node name contains '$' sign

Open dbugrimov opened this issue 7 years ago • 2 comments

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

dbugrimov avatar Aug 27 '18 08:08 dbugrimov

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.

djessup avatar Sep 10 '18 06:09 djessup

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

ElmiraZhernova avatar Apr 01 '19 09:04 ElmiraZhernova