? Failure

User tests: Successful: Unsuccessful:

avatar berserkerx
berserkerx
16 Jul 2017

If class name starts with the same token, as namespace prefix or contains namespace prefix, the class was not loaded correctly.

Pull Request for Issue #17098 .

Summary of Changes

Added check for '/' after namespace prefix, replaced 'str_replace' with 'substr' to ensure, that prefix is only removed from the start of class path.

Testing Instructions

Create libraries/app/vendor/B/src/B.php class with anyMethod method.

JLoader::registerNamespace('B', JPATH_SITE . '/libraries/app/vendor/B/src', $reset = true, $prepend = false, $type = 'psr4');
\B\B::anyMethod();

Expected result

Autoloading \B\B class and calling anyMethod.

Actual result

Class not found.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar berserkerx berserkerx - open - 16 Jul 2017
avatar berserkerx berserkerx - change - 16 Jul 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2017
Category Libraries
avatar berserkerx
berserkerx - comment - 24 Jul 2017

What's the reason of failure?

Branch indexing
Connecting to https://api.github.com using joomla-release/******
Loading trusted files from base branch staging at 48f58a6 rather than 81e8f47
Obtained Jenkinsfile from 48f58a6

[Pipeline] node
Still waiting to schedule task
Warte auf den nächsten freien Build-Prozessor

[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

ERROR: Queue task was cancelled
Finished: FAILURE


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

avatar berserkerx berserkerx - change - 7 Sep 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-09-07 15:10:02
Closed_By berserkerx
avatar berserkerx berserkerx - change - 7 Sep 2017
Status Closed Pending
avatar berserkerx berserkerx - close - 7 Sep 2017
avatar berserkerx berserkerx - close - 7 Sep 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Nov 2017
Status Pending Closed
Closed_Date 2017-09-07 15:10:02 2017-11-05 09:36:13
Closed_By berserkerx franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 5 Nov 2017

Add a Comment

Login with GitHub to post a comment