Bug #96567
closedphp ast catches wrong class
100%
Description
PHP AST recognizes the RecordsContentObject but mistakenly recognizes it as a PageRenderer and captures it as a page render class. This triggers the following error Breaking: #93003 - PageRenderer renders only full page
example method which throws the error
public function render()
{
$conf = $this->buildConfArray($this->arguments['uid']);
$recordsObjectManager = $this->objectManager->get(RecordsContentObject::class);
return $this->RecordsContentObject->render($conf);
}
I would like to request a modification of the scanner.
Files
Updated by Georg Ringer almost 3 years ago
- Status changed from New to Needs Feedback
thanks for creating the issue!
this is a weak and as there is only a static code check this is IMO fine. Read more about it at https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ExtensionScanner/Index.html
it is ok to close the issue?
Updated by Christian Kuhn almost 3 years ago
Hey.
As Georg already mentioned, this is a limit of the extension scanner. For non-static method calls, it basically does not know which on which object/class the method is called, so it just classifies the matching method name as "weak" match: A candidate to check.
For more information, see https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ExtensionScanner/Index.html#limits .
Updated by Christian Kuhn almost 3 years ago
However, since render() is such a generic method name, we are probably better off removing that matcher from the configuration and maybe adapt the .rst file of #93003 to 'not scanned'. This will help avoiding too many false positives in this very case.
Updated by Christian Kuhn almost 3 years ago
- Related to Task #93003: PageRenderer only renders full page anymore added
Updated by Gerrit Code Review almost 3 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73132
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73089
Updated by Christian Kuhn almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 50d4e2c3c969d1951e88328a9f08e53913d52a07.