From 00a8576049d4f1f17791b45b5f1261ae6722c12e Mon Sep 17 00:00:00 2001 From: pjohans Date: Fri, 10 Oct 2014 07:09:03 +0200 Subject: [PATCH 1/4] Issue #534 by pjohans: Make interest_period required to avoid --none-- selection. --- alma.features.field_instance.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alma.features.field_instance.inc b/alma.features.field_instance.inc index 6d03c53..3ff302b 100644 --- a/alma.features.field_instance.inc +++ b/alma.features.field_instance.inc @@ -124,7 +124,7 @@ function alma_field_default_field_instances() { 'entity_type' => 'profile2', 'field_name' => 'field_alma_interest_period', 'label' => 'Interest period', - 'required' => 0, + 'required' => 1, 'settings' => array( 'user_register_form' => FALSE, ), From 794e19d68bb48571aab8590a048be60f571311f7 Mon Sep 17 00:00:00 2001 From: pjohans Date: Fri, 10 Oct 2014 07:53:21 +0200 Subject: [PATCH 2/4] Issue #534 by pjohans: Get default_interest period for reservations --- includes/alma.reservation.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/alma.reservation.inc b/includes/alma.reservation.inc index 906d4d8..8f244ac 100644 --- a/includes/alma.reservation.inc +++ b/includes/alma.reservation.inc @@ -33,7 +33,7 @@ function alma_reservation_options($account, $default_value = '') { // Get values. $preferred_branch = $wrapper->field_alma_preferred_branch->value(); - $interest_period = $wrapper->field_alma_interest_period->value(); + $interest_period = (variable_get('alma_default_interest_period',FALSE)) ? variable_get('alma_default_interest_period') :$wrapper->field_alma_interest_period->value(); } // Set default value in the selection box if given else use preferred_branch. From 8c1155c7870934c459856b987114ccafb9ba4433 Mon Sep 17 00:00:00 2001 From: pjohans Date: Fri, 10 Oct 2014 08:43:07 +0200 Subject: [PATCH 3/4] Issue #534 by pjohans: More correct use method alma_reservation_default_interest_period to get interest period. --- includes/alma.reservation.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/alma.reservation.inc b/includes/alma.reservation.inc index 8f244ac..8f1eeae 100644 --- a/includes/alma.reservation.inc +++ b/includes/alma.reservation.inc @@ -33,7 +33,7 @@ function alma_reservation_options($account, $default_value = '') { // Get values. $preferred_branch = $wrapper->field_alma_preferred_branch->value(); - $interest_period = (variable_get('alma_default_interest_period',FALSE)) ? variable_get('alma_default_interest_period') :$wrapper->field_alma_interest_period->value(); + $interest_period = alma_reservation_default_interest_period($profile); } // Set default value in the selection box if given else use preferred_branch. From 678a5f975b0400ae09eac50b168e7c7b50e8fd92 Mon Sep 17 00:00:00 2001 From: pjohans Date: Fri, 10 Oct 2014 08:46:51 +0200 Subject: [PATCH 4/4] Issue #534 by pjohans: Undo make interest_period field required. --- alma.features.field_instance.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alma.features.field_instance.inc b/alma.features.field_instance.inc index 3ff302b..6d03c53 100644 --- a/alma.features.field_instance.inc +++ b/alma.features.field_instance.inc @@ -124,7 +124,7 @@ function alma_field_default_field_instances() { 'entity_type' => 'profile2', 'field_name' => 'field_alma_interest_period', 'label' => 'Interest period', - 'required' => 1, + 'required' => 0, 'settings' => array( 'user_register_form' => FALSE, ),