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 over 1 year ago. Updated 5 months ago.

Status:
Closed
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 about 1 year 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 about 1 year 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 about 1 year 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 about 1 year 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 about 1 year 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 about 1 year 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 about 1 year ago

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

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF