From 29c5b3665645812ae75ddde945a9c66d5b87a348 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Fri, 13 Mar 2015 15:15:59 +0100 Subject: [PATCH] DDBEASY-470 - Adds possibility to save empty branch. --- alma.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alma.module b/alma.module index d4dccde..018c664 100644 --- a/alma.module +++ b/alma.module @@ -311,7 +311,7 @@ function alma_profile2_presave($entity) { $value = $wrapper->field_alma_preferred_branch->value(); if (!is_null($value)) { if ($value != $wrapper_original->field_alma_preferred_branch->value()) { - $changes['preferred_branch'] = $value; + $changes['preferred_branch'] = $value == '_none' ? '' : $value; } } @@ -530,7 +530,7 @@ function alma_update_provider($changes, $entity) { } // Update preferred branch (patronBranch). - if (!empty($changes['preferred_branch'])) { + if (isset($changes['preferred_branch'])) { try { $res = alma_client_invoke('change_patron_preferences', $creds['name'], $creds['pass'], $changes['preferred_branch']); }