Skip to content

Commit edf7394

Browse files
server: search template name and display text if keyword is passed (#9215)
1 parent 2e3f76e commit edf7394

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4637,8 +4637,12 @@ private Pair<List<TemplateJoinVO>, Integer> templateChecks(boolean isIso, List<H
46374637
// other criteria
46384638

46394639
if (keyword != null) {
4640-
sc.addAnd("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
4641-
} else if (name != null) {
4640+
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();
4641+
scc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
4642+
scc.addOr("displayText", SearchCriteria.Op.LIKE, "%" + keyword + "%");
4643+
sc.addAnd("name", SearchCriteria.Op.SC, scc);
4644+
}
4645+
if (name != null) {
46424646
sc.addAnd("name", SearchCriteria.Op.EQ, name);
46434647
}
46444648

0 commit comments

Comments
 (0)