Bug #57825

Configuration option for defining loading order of extensions

Added by Hendrik Becker over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2014-04-11
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

It would be nice to have an additional configuration option in ext_emconf.php which allows to define the loading order of extensions, without defining a dependence.

Currently it is only possible to influence the loading order by defining dependencies:

'constraints' => array(
'depends' => array(
'typo3' => '6.2.0-6.2.999',
'php' => '5.2.0-5.4.999',
'realurl' => '1.12.0-1.12.999',
),
),

This is not suitable for my situation, because my extension does not require realurl. But in case realurl is installed, my extension must be loaded after realurl to hook into realurl correctly. My extension also works together with other extensions (cooluri, dbal, ..) but it also works without all of those.

It would be nice, if I could define which extensions (if already installed) should be loaded before and which should be loaded after my extension.

Thank you for your attention.


Related issues

Related to TYPO3 Core - Bug #58694: rtehtmlarea user settings are not shown in setup ext Closed 2014-05-11
Related to TYPO3 Core - Task #58701: Package metadata should include "suggest" information Closed 2014-05-11
Related to TYPO3 Core - Bug #51069: Updating extension changes load order Closed 2013-08-14
Related to TYPO3 Core - Bug #67200: TCA Overrides has wrong extension order Closed 2015-05-29

Associated revisions

Revision d8b4aae0 (diff)
Added by Markus Klein over 5 years ago

[TASK] Observe ext suggestions for ext loading order

Let the DependencyResolver take the suggest-part of the composer.json
or ext_emconf.php files into account. This solves issues where it is
necessary to ensure a certain loading order of extensions without
having a real dependency between those.

Resolves: #57825
Releases: 6.2
Change-Id: Ia771813b7945409e5ddaec3f19da27239be16e67
Reviewed-on: https://review.typo3.org/30005
Reviewed-by: Loek Hilgersom
Tested-by: Loek Hilgersom
Reviewed-by: Thomas Maroschik
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

History

#1 Updated by Markus Klein over 5 years ago

  • Status changed from New to Accepted

We're thinking about a solution

#2 Updated by Markus Klein over 5 years ago

Possible solution would be to use the "suggests" array in the emconf to announce such optional "dependencies".
In your case you would add realurl to the suggests constraints.

In case a suggested extension is depending on the suggesting one, the dependencies take precedence for the loading order.

#3 Updated by Christian Kuhn over 5 years ago

+1 for Markus idea.

#4 Updated by Markus Klein over 5 years ago

Well it was tmaroschik's idea while we discussed this. I just posted it. ;-)

#5 Updated by Markus Klein over 5 years ago

Ok this is more and more a real problem. rtehtmlarea needs to be loaded after setup extension in order to add the rte settings to the user settings. This is not a dependency and not really a suggestion. We could misuse "suggests" for this, but it does not really seem right to me. :-(

#6 Updated by Markus Klein over 5 years ago

I'm working on a first draft.

#7 Updated by Gerrit Code Review over 5 years ago

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

#8 Updated by Gerrit Code Review over 5 years ago

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/30006

#9 Updated by Markus Klein over 5 years ago

Can be tested with #58694.

#10 Updated by Gerrit Code Review over 5 years ago

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

#11 Updated by Gerrit Code Review over 5 years ago

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

#12 Updated by Gerrit Code Review over 5 years ago

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

#13 Updated by Gerrit Code Review over 5 years ago

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

#14 Updated by Gerrit Code Review over 5 years ago

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

#15 Updated by Stanislas Rolland over 5 years ago

Is it not strange to use the "suggest" option for this? Don't we need new options like "before" and/or "after"?

#16 Updated by Stanislas Rolland over 5 years ago

If you unsinstall both setup and rtehtmlarea, and then install rtehtmlarea, without first installing setup, the extension manager does not even care about suggesting to install setup first...

#17 Updated by Markus Klein over 5 years ago

suggest does not mean that EM should "force" you to install an extension.
I understand it more as a listing of what the author thinks is a good addition to his extension.

#18 Updated by Stanislas Rolland over 5 years ago

Markus Klein wrote:

suggest does not mean that EM should "force" you to install an extension.
I understand it more as a listing of what the author thinks is a good addition to his extension.

My understanding is that the extension manager should "suggest" to install it, and I think it used to do so.

#19 Updated by Markus Klein over 5 years ago

Ok, but with a checkbox in front to have it optional.

Still the question remains, can we introduce a before/after condition.

#20 Updated by Stanislas Rolland over 5 years ago

In fact, the extension being installed could be a pre-requisite to some of its "suggested" extensions.

#21 Updated by Markus Klein over 5 years ago

Stanislas: Have a look at the unit tests please.

This is the reason why dependencies take precedence over suggestions.
So if a "suggested" extension depends on the ext being installed (directly or indirectly), the suggestion is not taken into account for loading order calculation.

#22 Updated by Fabien Udriot over 5 years ago

Can we say in this regard that "suggest" would be a soft dependency? In case the suggested extension is installed, the "suggest" becomes a "require" for the Package Manager which will compute the correct order of extensions accordingly. This is how I understand it...

#23 Updated by Markus Klein over 5 years ago

Yes that's how this should be.

#24 Updated by Markus Klein over 5 years ago

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

#25 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF