fixed searching key for CMS status

This commit is contained in:
Francesco Mangiacrapa 2022-02-17 12:44:47 +01:00
parent 69a12e17e2
commit 3904cb48e0
2 changed files with 9 additions and 3 deletions

View File

@ -215,7 +215,7 @@ public class GCatCaller {
Map<String, String> queryParams = new HashMap<String, String>();
// queryParams.put(Moderated.SYSTEM_CM_ITEM_STATUS, status.getValue());
String modStatusField = Moderated.SYSTEM_CM_ITEM_STATUS.replaceAll(":", "_");
String modStatusField = Moderated.SYSTEM_CM_ITEM_STATUS.replaceAll(":", "");
queryParams.put("q", "extras_" + modStatusField + ":" + status.getValue());
if (limit < 0)

View File

@ -574,8 +574,14 @@ public class DataCatalogueImpl implements DataCatalogue {
*/
@Override
public boolean isModerationEnabled(boolean reloadConfig) {
Configuration config = gCatCaller.getConfiguration(reloadConfig);
return config.isModerationEnabled();
try {
LOG.info("Called isModerationEnabled with reloadConfig: " + reloadConfig);
Configuration config = gCatCaller.getConfiguration(reloadConfig);
return config.isModerationEnabled();
}catch (Exception e) {
LOG.error("Error occurred on checking if moderation is enabled. Returning false",e);
return false;
}
}
/**