J4 Issue ? ?
avatar dneukirchen
dneukirchen
21 Jun 2018

Introduced in #18703
This is the reason why system tests currently fail.

Not sure if this is an issue of the new manager or core. Depends on decision (see below)

The new plugin based autoloader is not able to load php classes from src folder.
We should probably extend the xml namespace definition and make it possible to point to folders ( i.e. <namespace folder="whatever">Joomla\X\Y\Z<namespace>) or auto-detect namespace in a src folder if it exists. We need a decision here @laoneo @wilsonge.

Additionally we have to register namespace at least for the PlgFileSystemLocal (LocalAdapter).

Steps to reproduce the issue

Open new media manager in current 4.0dev

Expected result

See media manager

Actual result

Error message:

0 Invalid controller class: display

System information (as much as possible)

4.0dev

Additional comments

avatar dneukirchen dneukirchen - open - 21 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Jun 2018
avatar dneukirchen dneukirchen - change - 21 Jun 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 21 Jun 2018
avatar dneukirchen dneukirchen - change - 21 Jun 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 21 Jun 2018
avatar dneukirchen dneukirchen - change - 21 Jun 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 21 Jun 2018
avatar dneukirchen dneukirchen - change - 21 Jun 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 21 Jun 2018
avatar wilsonge
wilsonge - comment - 21 Jun 2018

Short term hack here to make things work #20827

Please leave this open though because the fix you describe by extending the xml is clearly much better and should be implemented instead of my hack before we get to beta.

avatar wilsonge wilsonge - change - 21 Jun 2018
Labels Added: ?
avatar wilsonge wilsonge - labeled - 21 Jun 2018
avatar laoneo
laoneo - comment - 21 Jun 2018

As there is now one way to access a component, through the boot function. An alternative would be to give the classloading responsibility back to the extension itself. Means the namespace registration can be done while booting the extension.

avatar mbabker
mbabker - comment - 21 Jun 2018

The namespace mapper and autoloader shouldn't be using said boot function. Otherwise you're getting into a massively magical black box you don't want to be getting into.

avatar laoneo
laoneo - comment - 21 Jun 2018

What I mean, that the extension itself can register its namespaces during boot by itself and not something else.

avatar laoneo
laoneo - comment - 21 Jun 2018

I still think it is can bring us into troubles when users can disable the classmapping plugin.

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jun 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jun 2018
Category Unit Tests
avatar brianteeman brianteeman - change - 22 Jun 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 22 Jun 2018
avatar laoneo
laoneo - comment - 18 Aug 2018

At the moment we have the namespace information at three places. The manifest file, the database and the classmap file. I would cut out the database step as it is unflexible, what this issue revealed. So the classmap file will be generated out of the manifest files directly. This allows us to extend it with a destination folder or even multiple classpath's when needed. If @wilsonge you agree with tht then I will do next week a pr.

avatar wilsonge
wilsonge - comment - 18 Aug 2018

It depends what kind of timing issues this gives on the PR. I assume that parsing XML files is going to be slow. Because we'd have to parse ALL extension xml files on install, update and removal of any extension (what's going on in the namespace plugin).

avatar laoneo
laoneo - comment - 18 Aug 2018

Don't think so that timing will be an issue. If it is then we can optimise the classmap as an indexed array. So the extension can directly being added/updated/removed.

avatar wilsonge
wilsonge - comment - 18 Aug 2018

If it is then we can optimise the classmap

I'd like to avoid that. I've deliberately kept the classmap with the same format as the composer generated autoload files.

But let's see what the timing is like. The only reason I stored in the db was to 'solve' the theoretical timing issue to parse all the XML files.

avatar laoneo
laoneo - comment - 18 Aug 2018

I can make some tests how long it will take. If fine, would you be ok to skip the db? Then I can also implement the path attribute.

avatar wilsonge
wilsonge - comment - 18 Aug 2018

Yeah of course. If it doesn't take forever to rebuild the file then I'm totally happy with removing it from the db (literally the time to parse xml files was the only reason to store it in the db)

avatar joomla-cms-bot joomla-cms-bot - change - 20 Aug 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-08-20 14:21:27
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 20 Aug 2018
avatar joomla-cms-bot joomla-cms-bot - change - 20 Aug 2018
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - unlabeled - 20 Aug 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Aug 2018
Closed_Date 2018-08-20 14:21:27 2018-08-20 14:21:28
Closed_By joomla-cms-bot franz-wohlkoenig
Labels Added: ?
avatar joomla-cms-bot
joomla-cms-bot - comment - 20 Aug 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Aug 2018

closed as having Pull Request #21766

Add a Comment

Login with GitHub to post a comment