Skip to content

Comments

[4.0] Remove JError::raise code#17013

Merged
wilsonge merged 6 commits intojoomla:4.0-devfrom
Digital-Peak:j4/jerror-remove
Aug 21, 2017
Merged

[4.0] Remove JError::raise code#17013
wilsonge merged 6 commits intojoomla:4.0-devfrom
Digital-Peak:j4/jerror-remove

Conversation

@laoneo
Copy link
Member

@laoneo laoneo commented Jul 7, 2017

As discussed in #16952, this pr convertes the code which is calling JError::raise* in core. Next step would then be to remove the JError class.

Pinging @mbabker and @wilsonge for feedback.

catch (\RuntimeException $e)
{
\JError::raiseWarning(500, $db->getMessage());
\JFactory::getApplication()->enqueueMessage($db->getMessage(), 'error');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbabker My memory fails me, is this going to give sql queries or not? I don't think it does but wanna be sure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also does $db->getMessage() actually exist? I think this is a bug and should be $e->getMessage()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query exceptions only give the database's error message. The full query is a separate property on our exception class that's not part of the message.

laoneo added 2 commits July 8, 2017 17:11
…r-remove

# Conflicts:
#	administrator/components/com_contact/Field/Modal/ContactField.php
…r-remove

# Conflicts:
#	administrator/components/com_contact/Field/Modal/ContactField.php
switch ($authorisation->status)
{
case Authentication::STATUS_EXPIRED:
return \JError::raiseWarning('102002', \JText::_('JLIB_LOGIN_EXPIRED'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these numbers represent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An arbitrary code created by somebody long before our time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc there was a plan to have a series of joomla error codes beginning 10...

@brianteeman brianteeman modified the milestone: Joomla 4.0 Jul 19, 2017
…r-remove

# Conflicts:
#	administrator/components/com_admin/postinstall/eaccelerator.php
#	administrator/components/com_categories/Field/CategoryparentField.php
#	administrator/components/com_finder/Field/ContenttypesField.php
#	administrator/components/com_menus/Field/MenuParentField.php
#	administrator/components/com_menus/Field/MenuorderingField.php
#	administrator/components/com_menus/Field/Modal/MenuField.php
#	administrator/components/com_messages/Field/UserMessagesField.php
#	administrator/components/com_newsfeeds/Field/Modal/NewsfeedField.php
#	administrator/components/com_newsfeeds/Field/NewsfeedsField.php
#	administrator/components/com_redirect/Helper/RedirectHelper.php
#	administrator/modules/mod_popular/Helper/PopularHelper.php
#	components/com_content/Model/Article.php
@wilsonge wilsonge merged commit 4d20195 into joomla:4.0-dev Aug 21, 2017
@wilsonge wilsonge deleted the j4/jerror-remove branch August 21, 2017 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants