diff --git a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php index d2861922b..a37f486ba 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php @@ -232,9 +232,10 @@ public function hydrate(int $id, \App\Model\Entity\Petition $petition): bool return in_array($attr['enrollment_attribute']['attribute'], $groupAttributes); })->toArray(); - $groupMemberObj = TableRegistry::getTableLocator()->get('GroupMembers'); - $groupMemberObj->saveAttributeCollectorPetitionAttributes($person->id, $fieldsForGroup); - + if (!empty($fieldsForGroup)) { + $groupMemberObj = TableRegistry::getTableLocator()->get('GroupMembers'); + $groupMemberObj->saveAttributeCollectorPetitionAttributes($person->id, $fieldsForGroup); + } // Save the Date Of Birth. This is the only one that is single valued // and goes under the Person