? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
10 Aug 2017

Pull Request for Issue #17413.

Summary of Changes

If the class contains a PSR 4 namespace the file location is not correctly compiled. This pr fixes that.

Testing Instructions

  • Create a file Application.php with the following content in the App folder under the Joomla root directory:
<?php
namespace App;

class Application
{
	public static function loaded()
	{
		return 'LOADED!';
	}
}
  • Add the following code to the file components/com_content/content.php after line 36
JLoader::registerNamespace('App',JPATH_SITE.DIRECTORY_SEPARATOR.'App',false,false,'psr4');
echo \App\Application::loaded();die;
  • Open an article on the front end

Expected result

String LOADED! is printed.

Actual result

"Class 'App\Application' not found" error is displayed.

avatar joomla-cms-bot joomla-cms-bot - change - 10 Aug 2017
Category ⇒ Libraries
avatar laoneo laoneo - open - 10 Aug 2017
avatar laoneo laoneo - change - 10 Aug 2017
Status New ⇒ Pending
avatar Heggi93 Heggi93 - test_item - 22 Aug 2017 - Tested successfully
avatar Heggi93
Heggi93 - comment - 22 Aug 2017

I have tested this item ✅ successfully on 1eac297

For me it worked without the patch also, but the patch doesnt cause any errors


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

avatar lavipr lavipr - test_item - 22 Aug 2017 - Tested successfully
avatar lavipr
lavipr - comment - 22 Aug 2017

I have tested this item ✅ successfully on 1eac297

Steps:

  • followed the testing instruction, needed just to create the folder "App"

Before Patch: like expected - "Class 'App\Application' not found" error is displayed.
After Patch: like exptected - String LOADED! is printed.

Tested @icampus


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

avatar laoneo
laoneo - comment - 22 Aug 2017

Thanks guys!

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Aug 2017
Status Pending ⇒ Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Aug 2017

RTC after two successful tests.

avatar mbabker mbabker - change - 23 Aug 2017
Status Ready to Commit ⇒ Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 ⇒ 2017-08-23 11:52:21
Closed_By ⇒ mbabker
Labels Added: ?
avatar mbabker mbabker - close - 23 Aug 2017
avatar mbabker mbabker - merge - 23 Aug 2017

Add a Comment

Login with GitHub to post a comment