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

Don't consider "unassociated" child content types while matching files #1209

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -711,16 +711,20 @@ private Set<ContentType> selectMatchingByName(final IScopeContext context, Colle
internalAccept(new ContentTypeVisitor() {
@Override
public int visit(ContentType type) {
if (type != root && type.hasBuiltInAssociations())
if (type != root && type.hasBuiltInAssociations()) {
// this content type has built-in associations - visit it later as root
return RETURN;
if (type == root && !type.hasFileSpec(context, fileSpecText, fileSpecType))
// it is the root and does not match the file name - do not add it nor look into its children
return RETURN;
// either the content type is the root and matches the file name or
// is a sub content type and does not have built-in files specs
if (!existing.contains(type))
destination.add(type);
}
if (type == root) {
if (!type.hasFileSpec(context, fileSpecText, fileSpecType)) {
// it is the root and does not match the file name - do not add it nor look into its children
return RETURN;
}
// the content type is the root and matches the file name
if (!existing.contains(type)) {
destination.add(type);
}
}
return CONTINUE;
}
}, root);
Expand Down
Loading