From 8e9fd9e4d7b8783de68e948b011c5026bc1401bf Mon Sep 17 00:00:00 2001 From: kurund Date: Thu, 1 Aug 2013 00:30:27 +0530 Subject: [PATCH] CRM-13130, fixed notices and using Avery 5395 as default for layout format ---------------------------------------- * CRM-13130: New Label Format entries do not store the 'name' property in values colum, and produce blank name badges http://issues.civicrm.org/jira/browse/CRM-13130 --- CRM/Badge/BAO/Badge.php | 1 + CRM/Core/BAO/LabelFormat.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CRM/Badge/BAO/Badge.php b/CRM/Badge/BAO/Badge.php index 04ef2c42b7..a5479676f5 100644 --- a/CRM/Badge/BAO/Badge.php +++ b/CRM/Badge/BAO/Badge.php @@ -128,6 +128,7 @@ class CRM_Badge_BAO_Badge { public function generateLabel($formattedRow) { switch ($formattedRow['labelFormat']) { case 'Avery 5395': + default: self::labelAvery5395($formattedRow); break; } diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index e3637420ab..e771be35d8 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -511,6 +511,9 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { // serialize label format fields into a single string to store in the 'value' column of the Option Value table $v = json_decode($this->value, TRUE); foreach (self::$optionValueFields as $name => $field) { + if (!isset($v[$name])) { + $v[$name] = NULL; + } $v[$name] = self::getValue($name, $values, $v[$name]); } $this->value = json_encode($v); -- 2.25.1