?
avatar 810
810
9 Jan 2020

Steps to reproduce the issue

Install a libraries plugin or media plugin.

example: Kunena 6.0 Libraries

on kunena.xml file has

<namespace>Kunena\Forum\Libraries</namespace>

Expected result

autoload_psr4.php has the libraries namespace.

Actual result

No libraries or media dir has been added to the autoload_prs4.php file.

other namespaces has been added:

'Kunena\\Forum\\Site\\' => [JPATH_SITE . '/components/com_kunena/'],
'Kunena\\Forum\\Api\\' => [JPATH_API . '/components/com_kunena/'],
'Kunena\\Forum\\Administrator\\' => [JPATH_ADMINISTRATOR . '/components/com_kunena/'],
'Kunena\\Forum\\Plugin\\Kunena\\Altauserpoints\\' => [JPATH_PLUGINS . '/kunena/altauserpoints/'],
'Kunena\\Forum\\Plugin\\Kunena\\Community\\' => [JPATH_PLUGINS . '/kunena/community/'],
'Kunena\\Forum\\Plugin\\Kunena\\Comprofiler\\' => [JPATH_PLUGINS . '/kunena/comprofiler/'],
'Kunena\\Forum\\Plugin\\Kunena\\Finder\\' => [JPATH_PLUGINS . '/kunena/finder/'],
'Kunena\\Forum\\Plugin\\Kunena\\Gravatar\\' => [JPATH_PLUGINS . '/kunena/gravatar/'],
'Kunena\\Forum\\Plugin\\Kunena\\Joomla\\' => [JPATH_PLUGINS . '/kunena/joomla/'],
'Kunena\\Forum\\Plugin\\Kunena\\Kunena\\' => [JPATH_PLUGINS . '/kunena/kunena/'],
'Kunena\\Forum\\Plugin\\Quickicon\\Kunena\\' => [JPATH_PLUGINS . '/quickicon/kunena/'],	
'Kunena\\Forum\\Plugin\\System\\Kunena\\' => [JPATH_PLUGINS . '/system/kunena/'],

Also i tried on system plugin:

class plgSystemKunena extends CMSPlugin
{
	/**
	 * Method to register custom library.
	 *
	 * return  void
	 */
	public function onAfterInitialise()
	{
		\JLoader::registerNamespace('Kunena\\Forum\\Libraries', JPATH_LIBRARIES . '/kunena/');
	}
}

System information (as much as possible)

4.0-dev git

Additional comments

avatar 810 810 - open - 9 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 9 Jan 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Jan 2020
avatar 810 810 - change - 9 Jan 2020
The description was changed
avatar 810 810 - edited - 9 Jan 2020
avatar 810 810 - change - 9 Jan 2020
The description was changed
avatar 810 810 - edited - 9 Jan 2020
avatar 810 810 - change - 9 Jan 2020
The description was changed
avatar 810 810 - edited - 9 Jan 2020
avatar SharkyKZ
SharkyKZ - comment - 10 Jan 2020

Right, currently namespace mapper doesn't support libraries.

The plugin method should work but you need to pass the autoloading type (psr4) . JLoader::registerNamespace() doc block says it should default to psr4 in 4.0 but that hasn't been done yet.

Note, autoloading is based on filesystem. Directory/file casing must match class names otherwise the code will fail on case sensitive filesystems (Linux).

avatar SharkyKZ SharkyKZ - change - 11 Jan 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-01-11 14:23:49
Closed_By SharkyKZ
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jan 2020
Closed_Date 2020-01-11 14:23:49 2020-01-11 14:23:50
Closed_By SharkyKZ joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 11 Jan 2020
avatar joomla-cms-bot
joomla-cms-bot - comment - 11 Jan 2020

Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/27459

avatar SharkyKZ
SharkyKZ - comment - 11 Jan 2020

Please test PR #27479.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27459.

Add a Comment

Login with GitHub to post a comment