Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: node:repair fails with could not be converted to string #4795

Merged

Conversation

christoph-daehne
Copy link
Contributor

@christoph-daehne christoph-daehne commented Dec 6, 2023

Fixes the following crash during node:repair

./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

Upgrade instructions

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
    • There are not tests in place and I added none.
  • The PR is created against the lowest maintained branch -> 7.3
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

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 neos#4794
@christoph-daehne christoph-daehne force-pushed the 4794-could-not-be-converted-to-string branch from e72e954 to 1ea904d Compare December 6, 2023 11:51
$nodeData->getIdentifier(),
$propertyName,
$propertyType,
method_exists($propertyValue, '__toString') ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the whole "referring to" questionable, because we just don't know what is in there, it could literally be any object, so if __toString is even a sensible representation of the object in question is doubtful, I would actually just remove this. But fine with the fix for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had similar thoughts, but preferred a small chance of helpful information over none ;)

@crydotsnake crydotsnake linked an issue Dec 16, 2023 that may be closed by this pull request
1 task
@kitsunet kitsunet merged commit f760cf4 into neos:7.3 Dec 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: node:repair fails with could not be converted to string
3 participants