diff --git a/app/templates/element/petition/enrollmentFlowSteps/attributeCollectorsStep.php b/app/templates/element/petition/enrollmentFlowSteps/attributeCollectorsStep.php index 9ff02c4e3..82165c3e1 100644 --- a/app/templates/element/petition/enrollmentFlowSteps/attributeCollectorsStep.php +++ b/app/templates/element/petition/enrollmentFlowSteps/attributeCollectorsStep.php @@ -56,9 +56,9 @@ if(!empty($value) && str_ends_with($attribute->attribute, 'person_id')) { // We need to load the associated model data $associatedModel = $this->Petition->getRecordForId('person_id', $attr->value, ['PrimaryName']); - $value = $associatedModel[0]->primary_name->given . ' ' - . $associatedModel[0]->primary_name->family . ' ' - . '(ID: ' . $associatedModel[0]->id . ')'; + $value = $associatedModel['primary_name']['given'] . ' ' + . $associatedModel['primary_name']['family'] . ' ' + . '(ID: ' . $associatedModel['id'] . ')'; $value = $this->Html->link($value, ['controller' => 'people', 'action' => 'edit', $attr->value]); } elseif(!empty($value) && str_ends_with($attribute->attribute, '_id')) {