fixed bug

This commit is contained in:
Luca Frosini 2023-02-01 17:35:07 +01:00
parent 959b350674
commit e30794baa6
3 changed files with 6 additions and 7 deletions

View File

@ -163,8 +163,8 @@ public abstract class ModerationThread {
postUserMessage(cmItemStatus, userMessage);
}
public void postItemDeleted(CMItemStatus cmItemStatus) throws Exception {
this.cmItemStatus = cmItemStatus;
public void postItemDeleted() throws Exception {
this.cmItemStatus = null;
String fullName = ckanUser.getNameSurname();
String message = String.format(
"@**%s** deleted the item with name '%s' (id='%s')",

View File

@ -162,9 +162,9 @@ public class SocialNotificationModerationThread extends ModerationThread {
}
@Override
public void postItemDeleted(CMItemStatus cmItemStatus) throws Exception {
public void postItemDeleted() throws Exception {
this.create = false;
this.cmItemStatus = cmItemStatus;
this.cmItemStatus = null;
this.catalogueEventType = CatalogueEventType.ITEM_REMOVED;
notifyItemDeleted();
}
@ -218,7 +218,7 @@ public class SocialNotificationModerationThread extends ModerationThread {
catalogueEvent.setType(catalogueEventType);
catalogueEvent.setNotifyText(messageString);
catalogueEvent.setItemId(getSubject());
if(cmItemStatus == CMItemStatus.APPROVED) {
if(cmItemStatus!=null && cmItemStatus == CMItemStatus.APPROVED) {
catalogueEvent.setItemURL(new URL(itemURL));
}else {
catalogueEvent.setItemURL(new URL(getModerationURL()));

View File

@ -1467,9 +1467,8 @@ public class CKANPackage extends CKAN implements Moderated {
private void postItemDeleted() {
try {
if(isModerationEnabled()) {
CMItemStatus cmItemStatus = getCMItemStatus();
moderationThread.setItemCoordinates(itemID, name, itemTitle, itemURL);
moderationThread.postItemDeleted(cmItemStatus);
moderationThread.postItemDeleted();
}
} catch(WebApplicationException e) {
throw e;