? ? ? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
22 Aug 2017

JError is deprecated since ages and it was marked to be removed in Joomla 4 in the deprecate message. This pr cleans up the core from JError and removes the class.
It is the followup pr of #16952 and #16967 which is the last piece to have JExceptionand JError being removed.

avatar joomla-cms-bot joomla-cms-bot - change - 22 Aug 2017
Category Administration com_banners com_finder com_menus com_messages com_modules com_users Language & Strings Front End External Library Libraries Plugins Unit Tests
avatar laoneo laoneo - open - 22 Aug 2017
avatar laoneo laoneo - change - 22 Aug 2017
Status New Pending
avatar laoneo laoneo - change - 22 Aug 2017
The description was changed
avatar laoneo laoneo - edited - 22 Aug 2017
avatar laoneo laoneo - change - 23 Aug 2017
Labels Added: ? ? ?
avatar wilsonge
wilsonge - comment - 23 Aug 2017

can you fix conflicts here please?

avatar laoneo
laoneo - comment - 24 Aug 2017

Conflicts fixed

avatar joomla-cms-bot joomla-cms-bot - change - 26 Aug 2017
Category Administration com_banners com_finder com_menus com_messages com_modules com_users Language & Strings Front End External Library Libraries Plugins Unit Tests Administration com_banners com_finder com_menus com_messages com_modules com_users Language & Strings Front End Libraries Plugins Unit Tests
avatar laoneo
laoneo - comment - 26 Aug 2017

Conflicts fixed

avatar laoneo
laoneo - comment - 19 Nov 2017

What is the status of this one?

avatar mbabker
mbabker - comment - 19 Nov 2017

Are we positive that the use of getError and setError in JObject subclasses (or any place doing this still really) are OK with proper Exceptions and have no internal couplings to JError or JException mechanisms? If we can drop this side of the functionality without completely breaking those two methods which still have heavy use I think it's worth re-syncing this PR and doing a heavy testing round to make sure we're OK.

avatar laoneo
laoneo - comment - 20 Nov 2017

I'm going to resync when I get the ok from @wilsonge that it is getting in when all is fine.

avatar wilsonge
wilsonge - comment - 20 Nov 2017

JObject's setError method definitely just adds (what's doc-block documneted as) strings from an internal array https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Object/CMSObject.php#L229-L243 . In the getters we also deal with that string actually being an exception https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Object/CMSObject.php#L131-L182

So we're definitely safe for JObject classes. I guess I need to go back through this again and just check what classes are actually using JError directly - but most of this stuff is outdated docblocks iirc

avatar laoneo
laoneo - comment - 20 Nov 2017

As I did this pr, I removed every trace of JError.

avatar laoneo
laoneo - comment - 20 Nov 2017

Was a rather painless merge, so we are in sync again.

avatar wilsonge
wilsonge - comment - 28 Nov 2017

On review this looks fine to me. Let's get some heavy testing on this

avatar wilsonge wilsonge - change - 2 Feb 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-02 00:00:08
Closed_By wilsonge
avatar wilsonge wilsonge - close - 2 Feb 2018
avatar wilsonge wilsonge - merge - 2 Feb 2018
avatar wilsonge
wilsonge - comment - 2 Feb 2018

OK Well I'm sure we'll break some things - but clearly we need this and it's not getting tests

avatar skurvish
skurvish - comment - 21 Nov 2019

In my component migration to namespaces in preparation of J4 I am finding JError in src/Mail/Mail.php so it looks like not all traces of JError are gone.


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

avatar laoneo
laoneo - comment - 21 Nov 2019

@skurvish can you post here a link to the line you see this error? I can't find a reference to the class, just an entry of the logger with jerror.

avatar skurvish
skurvish - comment - 21 Nov 2019

In the current joomla git you can find JError at lines 118 & 154 in Mail/Mail.ph. You can also find it in Application/CMSApplication.php, Cache/Storage/RedisStorage.php, Client/ClientWrapper.php, Installer/Adapter/ComponentAdapter.php, Menu/SiteMenu.php, MVC/View/CategoryFeedView.php, MVC/Model/AdminModel.php & MVC/View/CategoryView.php. These are all in libraries/src

avatar mbabker
mbabker - comment - 21 Nov 2019

Are you looking at the right version of those files? It’s expected to still be there for 3.x versions, but should be gone in 4.0 (just looking at the Mail.php file it isn’t used in the 4.0 file).

avatar skurvish
skurvish - comment - 21 Nov 2019

Current github and my installed 3.9 version. Problem I am having is that I am running a namespaced WebApplication which I have loaded the framework (included defines.php & framework.php), created a class of WebApplication. If an error happens in Mail.php it is calling \JError which is not found.

Perhaps there is some other autoloader I need to call beforehand so that JError is found?

avatar wilsonge
wilsonge - comment - 21 Nov 2019

In J3 it is expected JError exists. We're only removing it in J4. You should be covered by the framework.php include which in turn loads the autoloaders in libraries/import.legacy.php which should autoload everything in libraries/legacy

avatar skurvish
skurvish - comment - 21 Nov 2019

Hmmm, but it doesn't seem to autoload JError. Where should I look for answers? I assume this area is solely for J4.

avatar wilsonge
wilsonge - comment - 21 Nov 2019

This Pull Request was to the J4 branch (hence why we assumed you were referring to J4 in your comment here). If you create a fresh issue and drop in a stack trace of the issue your getting we should be able to help more :)

avatar skurvish
skurvish - comment - 21 Nov 2019

OK. I fixed the reason JError was being called so will have to revert to the state which caused the error and then will post a fresh issue. Thanks.

Add a Comment

Login with GitHub to post a comment