Bug #41657

ActionRequest does not resolve correctly cased package key

Added by Jan-Erik Revsbech almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Must have
Category:
Package
Target version:
-
Start date:
2012-10-07
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:
easy

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

Related to TYPO3 Flow Base Distribution - Story #41031: Composer support for packagingResolvedChristian Jul Jensen2012-09-17

Actions
#1

Updated by Gerrit Code Review almost 9 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

#2

Updated by Jan-Erik Revsbech almost 9 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;
}
#3

Updated by Christopher Hlubek almost 9 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;
}

#4

Updated by Christopher Hlubek almost 9 years ago

  • Subject changed from PackageManager->createPackage does not create Package.php file to ActionRequest does not resolve correctly cased package key
#5

Updated by Gerrit Code Review almost 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396

#6

Updated by Jan-Erik Revsbech almost 9 years ago

Christopher Hlubek wrote:

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).

I submitted a patch set correcting the behaviour of the ActionRequest. I was unaware of the getCaseSensitivePackageKey method of the PackageManager.

#7

Updated by Gerrit Code Review almost 9 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396

#8

Updated by Gerrit Code Review almost 9 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396

#9

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15396

#10

Updated by Anonymous almost 9 years ago

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

Updated by Karsten Dambekalns over 8 years ago

  • Assignee set to Jan-Erik Revsbech

Also available in: Atom PDF