Project

General

Profile

Actions

Bug #77177

closed

Extension composer.json not properly loaded when installing extension via typo3-ter/*

Added by Markus Kasten almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
composer
Target version:
-
Start date:
2016-07-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The composer.json of an extension is not read properly by composer, when an extension is installed via typo3-ter/extname. This causes problems when composer searches for class-alias-maps for example.

Example:

in project composer.json:

...
    "require": {
        "typo3-ter/solr": "^3.1.0",
        ...
    }
...

The solr extensions composer.json contains the following part, which should trigger the class alias map generation:

...
"extra": {
    ...
    "typo3/class-alias-loader": {
      "always-add-alias-loader": true,
      "class-alias-maps": [
        "Migrations/Code/ClassAliasMap.php" 
      ]
    }
  }
...

But the extra section is not read properly ($package->getExtra() is empty when debugging the class alias loader). This is probably because composer ignores extra when writing vendor/composer/installed.json.

When solr is installed via apache-solr-for-typo3/solr, the extra section is copied to composers installed.json and found by the class alias loader. I'm not sure if this is a bug with composer, or composer is just not designed to be used this way.

The same applies to compatibility6 and other extensions, that use class alias maps. Extensions containing a composer.json should probably not be available via the typo3-ter/ vendor name on composer.typo3.org.

Actions #1

Updated by Helmut Hummel almost 7 years ago

  • Status changed from New to Needs Feedback

Extensions containing a composer.json should probably not be available via the typo3-ter/ vendor name on composer.typo3.org.

Having a composer.json and being registered on Packagist are two different things. But yes, if an extension is available on Packagist, it should not be referenced with typo3-ter/

Is someone is willing to contribute a patch to https://github.com/TYPO3/CmsComposerPackageGenerator, we could mark such packages as abandoned on composer.typo3.org
Should be doable.

Until then, we need to rely on communication to teach people to use the Packagist and developers to properly tag their extensions so that the versions match the TER versions

I tend to close this issue here, as this is nothing that can be fixed in TYPO3 itself, but needs mitigation in our infrastructure and good communication.

Actions #2

Updated by Helmut Hummel almost 7 years ago

BTW. you can still use the typo3-ter/ version of an extension with class alias map files, if you provide the reference to those files in your root composer.json

Actions #3

Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF