Bug #54314
Reflecting class TYPO3\Neos\Domain\Service\TypoScriptService while compiling
Status: | Resolved | Start date: | 2013-12-10 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 100% |
|
Category: | - | |||
Target version: | Base Distribution - 1.0 |
Description
Hi,
after install a fresh T3 Neos 1.0 with composer on a shared webhosting environment (confixx, suPHP, PHP 5.3) it fails on first request while compiling.
In System_Development.log the last message is
13-12-10 23:02:50 1612 DEBUG Flow Reflecting class TYPO3\Neos\Domain\Service\TypoScriptService 13-12-10 23:02:50 1476 CRITICAL Flow Uncaught exception #1355480641 in line 467 of /var/www/web76/html/neos/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Booting/Scripts.php: Flow: The compile run failed. Please check the error output or system log for more information. - See also: 2013121023022788d3ce.txt
and the thrown exception:
Uncaught exception #1355480641 in line 467 of /var/www/web76/html/neos/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Booting/Scripts.php: Flow: The compile run failed. Please check the error output or system log for more information. 13 TYPO3\Flow\Core\Booting\Scripts::executeCommand("typo3.flow:doctrine:compileproxies", array|16|) 12 TYPO3\Flow\Core\Booting\Scripts::compileDoctrineProxies(TYPO3\Flow\Core\Bootstrap) 11 TYPO3\Flow\Core\Booting\Scripts::initializeProxyClasses(TYPO3\Flow\Core\Bootstrap) 10 call_user_func(array|2|, TYPO3\Flow\Core\Bootstrap) 9 TYPO3\Flow\Core\Booting\Step::__invoke(TYPO3\Flow\Core\Bootstrap) 8 TYPO3\Flow\Core\Booting\Sequence::invokeStep(TYPO3\Flow\Core\Booting\Step, TYPO3\Flow\Core\Bootstrap) 7 TYPO3\Flow\Core\Booting\Sequence::invokeStep(TYPO3\Flow\Core\Booting\Step, TYPO3\Flow\Core\Bootstrap) 6 TYPO3\Flow\Core\Booting\Sequence::invokeStep(TYPO3\Flow\Core\Booting\Step, TYPO3\Flow\Core\Bootstrap) 5 TYPO3\Flow\Core\Booting\Sequence::invokeStep(TYPO3\Flow\Core\Booting\Step, TYPO3\Flow\Core\Bootstrap) 4 TYPO3\Flow\Core\Booting\Sequence::invoke(TYPO3\Flow\Core\Bootstrap) 3 TYPO3\Flow\Http\RequestHandler::boot() 2 TYPO3\Flow\Http\RequestHandler::handleRequest() 1 TYPO3\Flow\Core\Bootstrap::run()
I stepped through the source code and debugged it a bit and the reason for the problem I think is the @var Annotation of the followng properties in the class \TYPO3\Neos\Domain\Service\TypoScriptService
- $prependTypoScriptIncludes
- $appendTypoScriptIncludes
@var array in the format array('resources://MyVendor.MyPackageKey/Private/TypoScript/Root.ts2', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.ts2')
While compiling Flow calls the method expandType(...) in TYPO3\Flow\Reflection\ReflectionService to suggest the correct type of the @var annotation:
... // we try to find the class relative to the current namespace... $possibleFullyQualifiedClassName = sprintf('%s\\%s', $class->getNamespaceName(), $type); if (class_exists($possibleFullyQualifiedClassName)) { return $possibleFullyQualifiedClassName; } ...
For the properties $possibleFullyQualifiedClassName has e.g. the value \TYPO3\Neos\Domain\Service\array in the format array('resources://MyVendor.MyPackageKey/Private/TypoScript/Root.ts2', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.ts2')
The call class_exists(..) for this value breaks the compiling process.
Maybe the autoloader has a problem with the slashes ?
After removing the comment on both annotations (leave only @var array ) everything works.
$possibleFullyQualifiedClassName = sprintf('%s\\%s', $class->getNamespaceName(), $type);
if (class_exists($possibleFullyQualifiedClassName)) {
return $possibleFullyQualifiedClassName;
}expandType
Related issues
Associated revisions
[BUGFIX] Fix wrong type annotation that causes compilation problems
Change-Id: I3f398eb87567d7b55e0506d4bfa4c00a23d6a0aa
Releases: master, 1.0
Fixes: #54314
Reviewed-on: https://review.typo3.org/26375
Reviewed-by: Rens Admiraal
Reviewed-by: Christian Mueller
Reviewed-by: Aske Ertmann
Reviewed-by: Christopher Hlubek
Tested-by: Christopher Hlubek
[BUGFIX] Fix wrong type annotation that causes compilation problems
Change-Id: I3f398eb87567d7b55e0506d4bfa4c00a23d6a0aa
Releases: master, 1.0
Fixes: #54314
Reviewed-on: https://review.typo3.org/26376
Reviewed-by: Christopher Hlubek
Tested-by: Christopher Hlubek
History
#1 Updated by Bastian Waidelich over 1 year ago
- Status changed from New to Accepted
- Assigned To set to Bastian Waidelich
Hey Danny,
thanks a bunch for this elaborate report!
We'll look into it asap!
#2 Updated by Christian Müller over 1 year ago
Yes this is a great report and should be easy to fix.
#3 Updated by Gerrit Code Review over 1 year ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/26375
#4 Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 1.0 of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/26376
#5 Updated by Christopher Hlubek over 1 year ago
- Status changed from Under Review to Resolved
- Target version set to 1.0
- % Done changed from 0 to 100
#6 Updated by Bastian Waidelich over 1 year ago
Thanks for fixing this. We should also push a fix to Flow that fixes the ReflectionService from being confused by "@var array <any string>"