Project

General

Profile

Actions

Bug #96567

closed

php ast catches wrong class

Added by Tobias Kasprak over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2022-01-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
RecordsContentObject, PageRenderer
Complexity:
Is Regression:
Sprint Focus:

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

errorMessage.jpg (26.2 KB) errorMessage.jpg error message during run scan extension files in the admintools Tobias Kasprak, 2022-01-18 10:04

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #93003: PageRenderer only renders full page anymoreClosedBenni Mack2020-12-06

Actions
Actions #1

Updated by Georg Ringer over 2 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?

Actions #2

Updated by Christian Kuhn over 2 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 .

Actions #3

Updated by Christian Kuhn over 2 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.

Actions #4

Updated by Christian Kuhn over 2 years ago

  • Related to Task #93003: PageRenderer only renders full page anymore added
Actions #5

Updated by Gerrit Code Review over 2 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

Actions #6

Updated by Gerrit Code Review over 2 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

Actions #7

Updated by Christian Kuhn over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF