I would suggest displaying a more meaningful message, such as:
The author of this article no longer exist.
Or something along those lines. @brianteeman perhaps you could come up with a better warning message
JUser: :_load: Unable to load user with ID: 371
Category | ⇒ | Administration UI/UX |
Status | New | ⇒ | Confirmed |
Not really sure how to approach this. The message is coming from here:
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/user/user.php#L869
Only thing I can think of is using JInput
and a conditional statement:
$input = JFactory::getApplication()->input;
if ($input->get('layout') == 'edit')
{
JLog::add(JText::_('The author of this article is no longer a user on this site'), JLog::WARNING, 'jerror');
}
else
{
JLog::add(JText::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id), JLog::WARNING, 'jerror');
}
which I'm not sure is the best method.
@mbabker - any thoughts on how to approach this?
I would not be putting component specific stuff in JUser for starters. This is why arbitrarily logging things with the "jerror" category isn't a good mechanism of error handling. It'd be better if it threw an Exception but that apparently has B/C implications. So the only way around that would be to stop logging to the "jerror" category and force downstream uses of JUser::load()
to check for boolean false conditions and implement their own error handling mechanisms at a lower level (to include rendering a "friendly" message).
As vague as it is, the error message generated at the spot it is now is correct and even if it were throwing an Exception I wouldn't change it. Annoying because it's vague and generally not friendly, but this is a case of an error being rendered where it shouldn't be and it does actually state what the error condition is (can't load a user with the given ID) but it's not really pertinent to every site visitor.
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-25 12:51:11 |
Closed_By | ⇒ | C-Lodder |
Labels |
Added:
?
|
How about
"The author of this article is no longer a user on this site"
But also please check if it is just the created user that generates this
error - perhaps the modified user does as well - I dont remember