Project

General

Profile

Actions

Bug #78207

closed

Composer requirement to package that is not type=typo3-cms-extension

Added by Felix Kopp over 7 years ago. Updated about 4 years ago.

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

0%

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

Description

Not sure wether this behaviour is a bug or a missing feature or mis-configuration on my side.
I could not find a hint in the 8.x changelog documentation by searching for "composer", "depend", "package".

Scenario:
In TYPO3 8.3.1 in extension manager. A extension of type "typo3-cms-extension" exists and is required and installed via composer as composer package. That extension itself brings a requirement to further composer packages not of type "typo3-cms-extension". When pressing button "activate". A Exception is thrown in 8.3.1 in Extension Manager:

Exception output
"#1382276561: The package "XXX" depends on "YYY" which is not present in the system. (More information)"

A demo package composer file could be

{
"name": "demo/demo",
"description": "demo",
"type": "typo3-cms-extension",
"license": "proprietary",
"version": "1.2.3",
"require": {
"spipu/html2pdf": "~4.5.1"
},
"replace": {
"demo_demo": "self.version",
"typo3-ter/demo_demo": "self.version"
}
}

The exception is only thrown in extension manager.
This exception is not thrown when the extension is activated via EXT: typo3_console.

Actions #2

Updated by Mathias Schreiber over 7 years ago

I am pretty certain this is a bug.
I guess the EM treats composer.json files of an extension the same way as ext_emconf.php files, thus not resolving the dependencies outside of typo3conf/ext.

One question though.. you did not mention whether the dependency itself got installed, but since I guess you installed the extension via composer those dependencies were resolved correctly, right?

Actions #3

Updated by Felix Kopp over 7 years ago

Yes, everything "below" typo3 / in composer went through without problems: Libraries are downloaded and auto-loaded within vendor directory.

Also the activation of the extension works just fine without exceptions when done via typo3_console.

Seems like the source for this problem lies within the EM.

Actions #4

Updated by Riccardo De Contardi over 7 years ago

  • Category set to composer
Actions #5

Updated by Nicole Cordes about 7 years ago

  • Status changed from New to Needs Feedback

Hi,

Can you please provide your ext_emconf.php please?

Actions #6

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Needs Feedback to Under Review

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

Actions #7

Updated by Helmut Hummel almost 7 years ago

To reproduce:

set up a require section in composer.json and remove contraints section in ext_emconf.php

Actions #8

Updated by Helmut Hummel almost 7 years ago

  • TYPO3 Version changed from 8 to 7
  • PHP Version deleted (7.0)
Actions #9

Updated by Helmut Hummel almost 7 years ago

  • Status changed from Under Review to Needs Feedback

Hm, ok, the fix isn't easy.

I would go for the advice that constriants section in ext_emconf.php is mandatory and maybe throw a better exception if it is not present, but composer.json requirements exist

Actions #10

Updated by Susanne Moog about 4 years ago

  • Status changed from Needs Feedback to Closed

As proposed in the last comment, I did a PR for the documentation here https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/812 - note: in general, the dependency section of an em_conf should at this point never be empty, not only because of the comments here, but also because TER etc. require those settings.

Actions

Also available in: Atom PDF