Skip to content

Commit

Permalink
BUGFIX: node:repair fails with could not be converted to string
Browse files Browse the repository at this point in the history
Fixes the following crash during node:repair

```shell
./flow node:repair --dry-run --only removeBrokenEntityReferences
Dry run, not committing any changes.

Checking for broken entity references ...
Object of class Neos\Flow\Persistence\Doctrine\Proxies\__CG__\Neos\Media\Domain\Model\ImageVariant could not be converted to string

  Type: Error
  File: Data/Temporary/Development/SubContextWbWeb/Cache/Code/Flow_Object_Classes/Neos_ContentRepository_Command_NodeCommandControllerPlugin.php
  Line: 836
```

resolved #4794
  • Loading branch information
christoph-daehne committed Dec 6, 2023
1 parent 5fd80d6 commit 1ea904d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,16 @@ public function removeBrokenEntityReferences($workspaceName)
$convertedProperty->__load();
} /** @noinspection PhpRedundantCatchClauseInspection */ catch (EntityNotFoundException $e) {
$nodesWithBrokenEntityReferences[$nodeData->getIdentifier()][$propertyName] = $nodeData;
$this->dispatch(self::EVENT_NOTICE, sprintf('Broken reference in "<i>%s</i>" (%s), property "<i>%s</i>" (<i>%s</i>) referring to <i>%s</i>.', $nodeData->getPath(), $nodeData->getIdentifier(), $propertyName, $propertyType, $propertyValue));
$this->dispatch(self::EVENT_NOTICE, sprintf(
'Broken reference in "<i>%s</i>" (%s), property "<i>%s</i>" (<i>%s</i>)%s.',
$nodeData->getPath(),
$nodeData->getIdentifier(),
$propertyName,
$propertyType,
method_exists($propertyValue, '__toString') ?
' referring to <i>' . $propertyValue->__toString() . '</i>' :
''
));
$brokenReferencesCount ++;
}
}
Expand Down

0 comments on commit 1ea904d

Please sign in to comment.