diff --git a/app/src/Controller/ExternalIdentitySourcesController.php b/app/src/Controller/ExternalIdentitySourcesController.php index f32718045..d81a4efad 100644 --- a/app/src/Controller/ExternalIdentitySourcesController.php +++ b/app/src/Controller/ExternalIdentitySourcesController.php @@ -119,6 +119,13 @@ public function retrieve(string $id) { ->first(); $this->set('vv_external_identity_record', $externalIdentityRecordObj); + if($externalIdentityRecordObj === null) { + // I need an empty entity + $ExtIdentitySourceRecords = $this->getTableLocator()->get('ExtIdentitySourceRecords'); + // Create an empty entity for FormHelper + $externalIdentityRecordObj = $ExtIdentitySourceRecords->newEmptyEntity(); + } + [$title, , ] = StringUtilities::entityAndActionToTitle($externalIdentityRecordObj, StringUtilities::entityToClassName($externalIdentityRecordObj), 'view');