Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dependencies to TYPO3 Extensions without ext_emconf.php #541

Open
DanielSiepmann opened this issue Feb 14, 2024 · 3 comments · May be fixed by #542 or #634
Open

Add support for dependencies to TYPO3 Extensions without ext_emconf.php #541

DanielSiepmann opened this issue Feb 14, 2024 · 3 comments · May be fixed by #542 or #634

Comments

@DanielSiepmann
Copy link
Contributor

Does your feature request relate to a problem?

We removed all our ext_emconf.php files when updating from TYPO3 10 LTS to 12 LTS.
This leads to issues like:

UnexpectedValueException: The package "e2_ces" depends on "e2/e2-core" which is not present in the system.

Describe the solution you would like

Provide native support for composer only projects with multiple TYPO3 extensions that declare their dependencies on each other (for loading order).

Optionally, describe alternatives you considered

One could keep ext_emconf.php.

DanielSiepmann added a commit to DanielSiepmann/fork-testing-framework that referenced this issue Feb 14, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
@DanielSiepmann
Copy link
Contributor Author

Probably related to #511 and #510.

DanielSiepmann added a commit to DanielSiepmann/fork-testing-framework that referenced this issue Feb 14, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
DanielSiepmann added a commit to DanielSiepmann/fork-testing-framework that referenced this issue Feb 15, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
DanielSiepmann added a commit to DanielSiepmann/fork-testing-framework that referenced this issue Feb 15, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
@websi
Copy link

websi commented Jun 26, 2024

This is really annoying. Every new release our test fail because this will not be fixed.

It would be really nice if we can use the newest version with extension without "ext_emconf.php".

All our extension has no "ext_emconf.php".

@DanielSiepmann
Copy link
Contributor Author

I already opened a PR which should implement the solution.
I got distracted and couldn't finish my investigation regarding acceptance tests. Feel free to step in and investigate the issue. I hope this is the last missing piece.

kanow added a commit to undkonsorten/typo3-cute-mailing-registeraddress that referenced this issue Oct 14, 2024
Without ext_emconf ordering of loaded extension in tests is important.
There is already an issue about this topic on:
TYPO3/testing-framework#541
kanow added a commit to undkonsorten/typo3-cute-mailing-ttaddress that referenced this issue Oct 14, 2024
Without ext_emconf ordering of loaded extension in tests is important.
There is already an issue about this topic on:
TYPO3/testing-framework#541
sbuerk pushed a commit to DanielSiepmann/fork-testing-framework that referenced this issue Oct 15, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
sbuerk pushed a commit that referenced this issue Oct 15, 2024
The testing-framework internal composer package management
used to determine source location of extensions to provide
them in the functional test instances (legacy mode) stores
extension packages in internal property state by the TYPO3
extension key. In case `ext_emconf.php` does not exist in
a extension, the fallback determined it by normalizing the
package name from the composer name or used the basename
of the source location folder as extension key.

The fallback logic was based on the need to allow loading
functional test fixture extension.

TYPO3 extension are sensitive to loading order which is
determined in different ways depending on the installation
mode. To mimic the TYPO3 core legacy mode sorting, custom
package sorting has been added to the testing-framework,
which has to deal with the fact that extension may not
provide a `ext_emconf.php` anymore, which is not needed
for composer installations.

Extension depending on another extension failed to be
sorted correctly with following exception:

    UnexpectedValueException: The package "extension_key"
    depends on "composer/package-key" which is not present
    in the system.

The root cause for this is the fact, that the composer.json
entry for the `extension-key` has not been used as first
source when reading extension from the filesystem. With this
change, places dealing to determine extension key from package
now respects the composer.json extension-key as first source.

Resolves: #541
sbuerk pushed a commit that referenced this issue Oct 15, 2024
The testing-framework internal composer package management
used to determine source location of extensions to provide
them in the functional test instances (legacy mode) stores
extension packages in internal property state by the TYPO3
extension key. In case `ext_emconf.php` does not exist in
a extension, the fallback determined it by normalizing the
package name from the composer name or used the basename
of the source location folder as extension key.

The fallback logic was based on the need to allow loading
functional test fixture extension.

TYPO3 extension are sensitive to loading order which is
determined in different ways depending on the installation
mode. To mimic the TYPO3 core legacy mode sorting, custom
package sorting has been added to the testing-framework,
which has to deal with the fact that extension may not
provide a `ext_emconf.php` anymore, which is not needed
for composer installations.

Extension depending on another extension failed to be
sorted correctly with following exception:

    UnexpectedValueException: The package "extension_key"
    depends on "composer/package-key" which is not present
    in the system.

The root cause for this is the fact, that the composer.json
entry for the `extension-key` has not been used as first
source when reading extension from the filesystem. With this
change, places dealing to determine extension key from package
now respects the composer.json extension-key as first source.

Resolves: #541
Releases: main, 8
sbuerk pushed a commit to DanielSiepmann/fork-testing-framework that referenced this issue Nov 11, 2024
The internal array always uses the extension key.
Not having an ext_emconf.php with dependencies to extension keys, but
only a composer.json with dependencies to package names will always
result in:

    UnexpectedValueException: The package "extension_key" depends on "composer/package-key" which is not present in the system.

This is a common situation in modern TYPO3 projects where multiple
extensions are given which declare their internal dependencies to have
proper TYPO3 loading order.

A fallback from the dependency (which might be the composer name) to the
actual extension key is added.

Resolves: TYPO3#541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants