Skip to content

Commit

Permalink
if the retrieved entity is null create an empty one to allow the titl…
Browse files Browse the repository at this point in the history
…e calculation to succeed (#149)
  • Loading branch information
Ioannis authored Jan 26, 2024
1 parent 2414730 commit 847bbbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/Controller/ExternalIdentitySourcesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 847bbbf

Please sign in to comment.