User tests: Successful: Unsuccessful:
Gracefully handle cache related errors in com_cache versus hitting the error page.
Catch some exceptions when trying to read data from the cache store and display a relevant message related to the failure.
Clean and purge operations should also catch these exceptions to notify the calling code of an error state. The controller methods are already checking for boolean false returns so the error handling already exists.
Remove a useless casting from boolean to integer.
When the cache can't be reached for read, clean, or purge operations, the error conditions should be gracefully handled versus fatal errors.
N/A
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_cache Language & Strings |
Sometimes I think that joomla should remove empty()
function from whole project and replace it with !==
or similar.
For me if (empty($var))
is equal to if (isset($var) && $var)
Displaying the message three times probably means there's a way to optimize the code to not run other functions if fetching the base data fails, but I'd consider that outside scope of this PR. The main thing to accomplish here is to block an unhandled Exception thrown by reading from the cache store and have a semi-graceful fallback.
I have tested this item
I set up cache handler as memcached and turn it off in joomla. Then go to clear cache and I saw message as I mentioned before.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-09 16:44:15 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
?
|
On test at got:
getData
is called 3 times:https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_cache/models/cache.php#L210
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_cache/models/cache.php#L225
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_cache/views/cache/view.html.php#L40