From 20aaed97c50758247616ec2110c8252ee51cf411 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 20 Sep 2017 16:57:45 +0100 Subject: [PATCH] Quick Fix for SubscripttonManagement servlet The UpdateSubscriptions() function was considering a subsciption with missing status parameter as a 'subscription to update to unset'. It mainly because the getTriBoxValue function return the same thing whether the value of the parameter is 'null' or 'unset'. Therefore, this fix simply make sure the parameter wasn't 'null' before updating the subscription. --- .../lockss/servlet/SubscriptionManagement.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/org/lockss/servlet/SubscriptionManagement.java b/src/org/lockss/servlet/SubscriptionManagement.java index f8617c1ed54..330c7161e77 100644 --- a/src/org/lockss/servlet/SubscriptionManagement.java +++ b/src/org/lockss/servlet/SubscriptionManagement.java @@ -2793,17 +2793,21 @@ private SubscriptionOperationStatus updateSubscriptions() { if (log.isDebug3()) log.debug3(DEBUG_HEADER + "oldPublisherSubscriptionSetting = " + oldPublisherSubscriptionSetting); - + + String id = (PUBLISHER_SUBSCRIPTION_WIDGET_ID_PREFIX + + publisherSubscription.getPublisher().getPublisherSeq()) + .trim(); Boolean newPublisherSubscriptionSetting = getTriBoxValue( - parameterMap, - PUBLISHER_SUBSCRIPTION_WIDGET_ID_PREFIX - + publisherSubscription.getPublisher().getPublisherSeq()); + parameterMap, id); if (log.isDebug3()) log.debug3(DEBUG_HEADER + "newPublisherSubscriptionSetting = " + newPublisherSubscriptionSetting); - publisherSubscription - .setSubscribed(newPublisherSubscriptionSetting); + if(parameterMap + .get(id + TRI_STATE_WIDGET_HIDDEN_ID_SUFFIX) != null ){ + publisherSubscription + .setSubscribed(newPublisherSubscriptionSetting); + } // Get an indication of whether the publisher subscription has been // changed.