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

BUG: node:repair fails with could not be converted to string #4794

Closed
1 task done
christoph-daehne opened this issue Dec 6, 2023 · 1 comment · Fixed by #4795
Closed
1 task done

BUG: node:repair fails with could not be converted to string #4794

christoph-daehne opened this issue Dec 6, 2023 · 1 comment · Fixed by #4795
Labels

Comments

@christoph-daehne
Copy link
Contributor

christoph-daehne commented Dec 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

www-data@a314a99200e9:/app$ ./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

Expected Behavior

The node:repair dry-run does not crash.

Steps To Reproduce

No response

Environment

- Flow: 7.3.11
- Neos: 7.3.12
- PHP: 8.1.21

Anything else?

This is an error in the logging in the Neos.ContentRepository/Classes/Command/NodeCommandControllerPlugin.php line 836

                    if ($convertedProperty instanceof Proxy) {
                        try {
                            $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));
                            $brokenReferencesCount ++;
                        }
                    }

The $propertyValue cannot be logged as %s.

@christoph-daehne
Copy link
Contributor Author

I currently working on a fix.

christoph-daehne added a commit to christoph-daehne/neos-development-collection that referenced this issue Dec 6, 2023
… string

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
```

Closes neos#4794
@christoph-daehne christoph-daehne changed the title BUG: node:repair fails with ImageVariant could not be converted to string BUG: node:repair fails with could not be converted to string Dec 6, 2023
@crydotsnake crydotsnake linked a pull request Dec 16, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant