Bug #41657
ActionRequest does not resolve correctly cased package key
100%
Description
The methods createPackage in class TYPO3\Flow\Package\PackageManage no longers generates the Package.php. The kickstart:package command uses this methods when kickstarting new packages, and the missing Package.php lead to seemingly unrelated errors like not not being able to correctly translate lower-case packagename to correct packagename.
I'm not sure why the file is no longer generated, it seems to be in relation to the Composer changes of the PackageManager, and it might very well be by intention.
If its by intention, we need to change the setControllerPackageKey of ActionRequest, since it calls the ObjectManger->getCaseSensitiveObjectName looking for the Package class, which when missing fails to find the correct PackageKey.
Anyone knows if its by intention it was omitted from the packagemanager?
Related issues
Updated by Gerrit Code Review over 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396
Updated by Jan-Erik Revsbech over 8 years ago
It seems to be intentional that the Package.php is not generated.
If the Package.php class i optional, then I think its an error that setControllerPackageKey on the ActionRequest uses uses ObjectManager->getCaseSensitiveObjectName to retrieve the actual package key, or am I totally missing something?
public function setControllerPackageKey($packageKey) {
$upperCamelCasedPackageClassName = $this->objectManager->getCaseSensitiveObjectName(str_replace('.', '\\', $packageKey) . '\Package');
$this->controllerPackageKey = ($upperCamelCasedPackageClassName !== FALSE) ? substr(str_replace('\\', '.', $upperCamelCasedPackageClassName), 0, strlen($packageKey)) : $packageKey;
}
Updated by Christopher Hlubek over 8 years ago
- Priority changed from Should have to Must have
Yes, it seems like the usage of getCaseSensitiveObjectName
always expects a class named Package
. We have to fix this behavior and use the correction of the package key inside the PackageManager (getCaseSensitivePackageKey
).
Jan-Erik Revsbech wrote:
It seems to be intentional that the Package.php is not generated.
If the Package.php class i optional, then I think its an error that setControllerPackageKey on the ActionRequest uses uses ObjectManager->getCaseSensitiveObjectName to retrieve the actual package key, or am I totally missing something?
public function setControllerPackageKey($packageKey) {
$upperCamelCasedPackageClassName = $this->objectManager->getCaseSensitiveObjectName(str_replace('.', '\\', $packageKey) . '\Package');
$this->controllerPackageKey = ($upperCamelCasedPackageClassName !== FALSE) ? substr(str_replace('\\', '.', $upperCamelCasedPackageClassName), 0, strlen($packageKey)) : $packageKey;
}
Updated by Christopher Hlubek over 8 years ago
- Subject changed from PackageManager->createPackage does not create Package.php file to ActionRequest does not resolve correctly cased package key
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396
Updated by Jan-Erik Revsbech over 8 years ago
Christopher Hlubek wrote:
Yes, it seems like the usage of
getCaseSensitiveObjectName
always expects a class namedPackage
. We have to fix this behavior and use the correction of the package key inside the PackageManager (getCaseSensitivePackageKey
).
I submitted a patch set correcting the behaviour of the ActionRequest. I was unaware of the getCaseSensitivePackageKey
method of the PackageManager.
Updated by Gerrit Code Review over 8 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396
Updated by Gerrit Code Review over 8 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396
Updated by Gerrit Code Review over 8 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396
Updated by Anonymous over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b744c359a9ff0373a5c22926cf3577468bbe952e.