Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When uploading .content.xml file, some child nodes may get deleted #4

Open
marcinus opened this issue Jul 22, 2021 · 0 comments
Open
Assignees

Comments

@marcinus
Copy link

I've had a following structure of files:

- myComponent [directory]
  - .content.xml
  - _cq_dialog.xml
  - _cq_editConfig.xml
  - myComponent.html

The contents of .content.xml was as following:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Component"
    someproperty="somevalue">
</jcr:root>

When uploaded this file using the Ctrl-P shortcut, the files (nodes) _cq_dialog.xml, _cq_editConfig.xml and myComponents.html got deleted from the JCR. This did not happen when uploading other files individually, or the whole folder.

This also did not happen when I explicitly specified child nodes in the .content.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Component"
    someproperty="somevalue">
    <cq:dialog/>
    <cq:editConfig/>
    <myComponent.html/>
</jcr:root>

So apparently, uploading only .content.xml file into the JCR that does not have child nodes specified results in removing all child nodes from the repository. Perhaps it would be useful to detect such cases (eg. when there are other files in the working directory in the local file system). Then a warning, or an error could be raised, and a --force flag could be required to perform this action (just an idea).

@devzbysiu devzbysiu self-assigned this Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants