core icon indicating copy to clipboard operation
core copied to clipboard

ESContentletAPIImpl :: deleteUnrelatedContents seems to do something unnecessary

Open mabouza opened this issue 13 years ago • 3 comments

In the ESContentletAPIImpl :: deleteUnrelatedContents method we have this code

if (!contentSelected) {
                if (related.isHasParent()) {
                    tree = TreeFactory.getTree(contentlet.getIdentifier(), relatedContent.getIdentifier(), related.getRelationship().getRelationTypeValue());
                } else {
                    tree = TreeFactory.getTree(relatedContent.getIdentifier(), contentlet.getIdentifier(), related.getRelationship().getRelationTypeValue());
                }
                Tree treeToDelete = TreeFactory.getTree(tree);
                TreeFactory.deleteTree(tree);
            }

treeToDelete is not used anywhere on the code. not sure if we should be deleting tree or treeToDelete?

i think treeToDelete is just not needed right?

mabouza avatar Jun 11 '13 16:06 mabouza

We need to be careful here - we might need it to refresh the hibernate session before we delete it.

dotcmsCodeReview avatar Jun 11 '13 16:06 dotcmsCodeReview

look at this in 3.0

jtesser avatar Jun 11 '13 17:06 jtesser

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Sep 29 '19 10:09 stale[bot]