You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/09/02 07:35:56 UTC

[GitHub] [jackrabbit-filevault] ankitaagar commented on a change in pull request #163: JCRVLT-549 - node cannot be deleted if it's a multi-mandatory child node

ankitaagar commented on a change in pull request #163:
URL: https://github.com/apache/jackrabbit-filevault/pull/163#discussion_r700825682



##########
File path: vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java
##########
@@ -1215,10 +1215,11 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
                             }
                         } else {
                             if (wspFilter.getImportMode(path) == ImportMode.REPLACE) {
+
                                 // check if child is not protected
                                 if (child.getDefinition().isProtected()) {
                                     log.debug("Refuse to delete protected child node: {}", path);
-                                } else if (child.getDefinition().isMandatory() && numChildren <= JcrConstants.NUM_MANDATORY_CHILDREN) {
+                                } else if (child.getDefinition().isMandatory() &&  getSiblWithReqPrimType(child) < 0) {

Review comment:
       Missed the = here. It's <=0. 
   If there is a single mandatory node and that can be replaced with another mandatory node of the same type. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org