?
avatar akurczyn
akurczyn
25 Feb 2015

Steps to reproduce the issue

A module has the following line:
$fullnoimage = Jstring::substr_replace($fullnoimage, '', $ini, $fin - $ini + 1);

Expected result

It should just return the expected string replacement.

Actual result

Fatal error: Class 'Jstring' not found in .../default_parse.php on line 46

System information (as much as possible)

Joomla 3.3.6 updated to 3.4

Additional comments

AFAIK the way the call is being made is correct, does it need to be done differently on Joomla 3.4?

Votes

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

avatar akurczyn akurczyn - open - 25 Feb 2015
avatar Fedik
Fedik - comment - 25 Feb 2015

try JString

avatar akurczyn
akurczyn - comment - 25 Feb 2015

That works. Is there a reason why this was case insensitive before and now it is not?

avatar Fedik
Fedik - comment - 25 Feb 2015

in global PHP class and methods is case insensitive,

in Joomla, class autoloader is case sensitive.
In your case it worked before because JString was loaded already somewhere else

avatar mbabker
mbabker - comment - 25 Feb 2015

With some refactoring between 3.3.6 and 3.4.0, JString went from a class that was loaded very early in the stack to being a class that can optionally not be used at all in a request cycle. For many autoloaders, the first use of a class is going to be the most sensitive to cases. So for consistency, it's best to always use the case as it's declared by the class.

avatar akurczyn akurczyn - close - 25 Feb 2015
avatar zero-24 zero-24 - close - 25 Feb 2015
avatar akurczyn
akurczyn - comment - 25 Feb 2015

Thanks a lot for the help!

avatar akurczyn akurczyn - change - 25 Feb 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-02-25 18:20:42
avatar akurczyn akurczyn - close - 25 Feb 2015
avatar zero-24 zero-24 - change - 17 May 2015
Labels Added: ?
Build 3.4 staging
avatar ogonzy
ogonzy - comment - 30 Jul 2015

This help really worked for me. Thank you very much for posting.

Add a Comment

Login with GitHub to post a comment