Added support for status ANY

This commit is contained in:
Luca Frosini 2022-04-21 15:41:13 +02:00
parent 88bea376f3
commit 49b8424965
1 changed files with 5 additions and 5 deletions

View File

@ -1058,11 +1058,6 @@ public class CKANPackage extends CKAN implements Moderated {
if(isModerationEnabled()) { if(isModerationEnabled()) {
String q = parameters.get(GCatConstants.Q_KEY); String q = parameters.get(GCatConstants.Q_KEY);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("(");
stringBuffer.append(CM_STATUS_QUERY_FILTER_KEY);
stringBuffer.append(":");
CMItemStatus cmItemStatus = getRequestedCMItemStatus(); CMItemStatus cmItemStatus = getRequestedCMItemStatus();
this.apiKey = CKANUtility.getSysAdminAPI(); this.apiKey = CKANUtility.getSysAdminAPI();
@ -1092,7 +1087,12 @@ public class CKANPackage extends CKAN implements Moderated {
cmItemStatus = CMItemStatus.APPROVED; cmItemStatus = CMItemStatus.APPROVED;
} }
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("(");
stringBuffer.append(CM_STATUS_QUERY_FILTER_KEY);
stringBuffer.append(":");
stringBuffer.append(cmItemStatus.getValue()); stringBuffer.append(cmItemStatus.getValue());
if(cmItemStatus == CMItemStatus.APPROVED) { if(cmItemStatus == CMItemStatus.APPROVED) {
stringBuffer.append(" OR (*:* -"); stringBuffer.append(" OR (*:* -");
stringBuffer.append(CM_STATUS_QUERY_FILTER_KEY); stringBuffer.append(CM_STATUS_QUERY_FILTER_KEY);