Project

General

Profile

Actions

Bug #101590

closed

Composer package vendors for TYPO3 extensions ending with "ext" don't get symlinked into public/_assets

Added by Georg Ringer 9 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
composer
Target version:
-
Start date:
2023-08-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

this has been reported at stackoverflow at https://stackoverflow.com/questions/76829256/composer-package-vendors-for-typo3-extensions-ending-with-ext-dont-get-symlin

When the composer package vendor of a TYPO3 extension ends with "ext", the "Resources/Public" directory of the extension does not get symlinked into public/_assets.

Example: typo3_ext/my_extension

This is because of this line:

vendor/typo3/cms-core/Classes/Composer/PackageArtifactBuilder.php:264

if (str_contains($path, 'ext/' . $extensionKey) || !file_exists($fileSystemResourcesPath)) {
    continue;
}

When it is changed to this, it works for me:

if (str_contains($path, '/ext/' . $extensionKey) || !file_exists($fileSystemResourcesPath)) {
    continue;
}

Since $path contains the full path, I guess that change should be OK?

TYPO3 12.4.4

Actions #1

Updated by Garvin Hicking 8 months ago

Looks good to me, I'd +1 this patch - or I can offer to create one based on this issue? ;-)

Extensions could be called "SuperText" or something like that, many things could end in "text", "next" - or even people shorting their names to "mycoolext".

Actions #2

Updated by Stefan Bürk 7 months ago

only from reading the issue, I'm not happy with the suggested sulution at all.
Without debugging and just opend the `PackageArtifactBuilder` I guess following
would be amore proper check for the if condition:

// skip non-composer installation extension paths and if resource paths does not exists.
if (str_ends_with($path, '/typo3conf/ext/' . $extensionKey) || !file_exists($fileSystemResourcesPath)) {
  continue;
}

This check is to rule `legacy` installation extension paths out. As $fileSystemResourcePath is directly
defined before the if as

$fileSystemResourcesPath = $path . '/Resources/Public';

and therefore the end with should be safe.
Actions #3

Updated by Garvin Hicking 6 months ago

Good catch, and yes, I believe being restrictive on the legacy syntax like this should work out.

I did a small check on the packagist repository, currently these public extensions would be affected by the bug:

aoe/t3deploy-ext
beewilly/form-element-linked-text
bitpatroon/bpn-variable-text
clickstorm/go-maps-ext
cron/eu-cron-context
kitzberger/form-mailtext
localizationteam/localizer-supertext
nreach/nreach-t3-text
teufels/form-element-linked-text

I don't want to hijack things, shall I create a patch based on this?

Actions #4

Updated by Gerrit Code Review 6 months ago

  • Status changed from Accepted 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/+/81716

Actions #5

Updated by Garvin Hicking 6 months ago

I initially misunderstood the issue, I thought the extension name would be the culprit, while in fact it is the vendor name (like described).

So a vendor like "next" or "Agencytext" would trigger this.

I implemented Stefans suggestion in a patch, and we could also re-use the existing constant here.

Actions #6

Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81782

Actions #7

Updated by Garvin Hicking 5 months ago

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

Also available in: Atom PDF