printing labels for members with missing address
authorFranky Van Liedekerke <liedekef@telenet.be>
Mon, 8 Aug 2016 22:03:18 +0000 (00:03 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Aug 2016 22:03:18 +0000 (00:03 +0200)
If trying to print address labels for a group of members (via the Search menu), if there's 1 member without address no PDF is generated.
The $rows variable only contains entries for members that actually have an address, so we need to check that.

CRM/Member/Form/Task/Label.php

index 0ee9e7cf73e07166c3c19101f791ab795d5df7fd..9ea8c8645ae006e8f6d6b9f2397e0dafa43af3e2 100644 (file)
@@ -133,7 +133,8 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
         'return' => 'contact_id',
       ));
       foreach ($memberships['values'] as $id => $membership) {
-        $labelRows[$id] = $rows[$membership['contact_id']];
+        if (isset($rows[$membership['contact_id']]))
+          $labelRows[$id] = $rows[$membership['contact_id']];
       }
     }
     else {