Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Classes/Composer/ComposerPackageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getPackageInfoWithFallback(string $nameOrExtensionKeyOrPath): ?P
*/
public function getPackageInfo(string $name): ?PackageInfo
{
return self::$packages[$this->resolvePackageName($name)] ?? null;
return self::$packages[$name] ?? self::$packages[$this->resolvePackageName($name)] ?? null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to fix resolvePackageName() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't any need to resolve known package names.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are both right and wrong.

If vendor/package-name is handed over it's okay to short-ciruit here and solving the issue in that case.

But when extkey or a folder with extkey is passed, for example in extensions from older days having:

  • typo3conf/ext/<my_ext_key> or /extension-root-path/typo3conf/ext/<my_ext_key>
  • typo3/sysext/<sys_ext_key or /extension-root-path/typo3conf/ext/<my_ext_key>

it fallbacks to resolvePackageName. Could be that this still leads to an issue. Not tested yet.

I had in mind to rework the resolve logic to create "candidates" for the different forms and doing lookups instead of simply returning only "one" value form resolvePackageName() or similar.

I guess that we could do that as a first fix even if it only fixes it for a subset of cases.

Removing the basename() thingy - not sure about that, there was a reason why I added it back then for 12.5.0 release ... need to check my notes.

}

/**
Expand Down Expand Up @@ -655,7 +655,6 @@ private function removePrefixPaths(string $path): string
rtrim($this->rootPackage()->getVendorDir(), '/') . '/',
rtrim($this->rootPackage()->getWebDir(), '/') . '/',
rtrim($this->getRootPath(), '/') . '/',
basename($this->getRootPath()) . '/',
];
foreach ($removePaths as $removePath) {
if (str_starts_with($path, $removePath)) {
Expand Down