? ? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
20 Feb 2016

Description

When deleting cached items, the user performs and action,so like in many other views, should receive a success or error message.

So, this PR:

  • adds success messages when deleting cache
  • adds error messages when an error occured when deleting cache

Also:

  • removes deprecated JError usage from com_cache
  • other code/coments improvements (check code changes)

How to test

  1. Use latest staging
  2. Go to System -> Global configuration and enable some type of caching
  3. Navigate in the backend and in the frontend to generate some cache
  4. Go to System -> Clear Cache, you will see some cached items in "site" and in "administrator"
  5. Delete some items, you will see you get no message after the page reloads.
  6. Apply this patch
  7. Repeat step 5. You will get a success message.

For testing error messages you need to simulate an error (like changing a cache group folder permissions in /cache/).

avatar andrepereiradasilva andrepereiradasilva - open - 20 Feb 2016
avatar andrepereiradasilva andrepereiradasilva - change - 20 Feb 2016
Title
[com_cache] Sucess and error messages
[com_cache] Success and error messages
avatar richard67
richard67 - comment - 20 Feb 2016

@andrepereiradasilva I could test the success message, but I was not able to provoke an error for testing the error message. Rename page to page1 folder in cache, or changing permissions did not help. It seems the cache cleaner helps itself if permissions do not fit. Shall I mark my test result as success anyway?


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Feb 2016

If in linux, did you try to change the owner/group of cache group folder to one that your php as no permissions do write?

avatar brianteeman brianteeman - change - 20 Feb 2016
Category Templates (admin) UI/UX
avatar brianteeman brianteeman - change - 20 Feb 2016
Easy No Yes
avatar richard67
richard67 - comment - 20 Feb 2016

Is Linux shared hosting, not really useful to do a chown because am not root.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Feb 2016

this class method (https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/cache/storage/file.php#L417) has to generate some kind of error (in other words, return false).

You can temporary add a return false; in the beggining of the class method just to test.

BTW nice comment in that class method :)

avatar richard67
richard67 - comment - 20 Feb 2016

@andrepereiradasilva I did modify the file as you said, but still see only a sucess message. But the size of the cache group is same, so nothing was deleted. Any idea what I do wrong?

avatar richard67
richard67 - comment - 20 Feb 2016

@andrepereiradasilva No, sorry, seems files are deleted, and success message, with the file hacked as you mentioned => ???

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Feb 2016

Do you have cache enabled with "File" cache handler in global config?

Do you have https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/cache/storage/file.php#L417 starting like this?

    protected function _deleteFolder($path)
    {
        return false;
        // Sanity check
        /* Rest of the code */
    }

It should work.

avatar richard67
richard67 - comment - 20 Feb 2016

No, I used Cache_Lite. But this one also uses the files, or not?

avatar richard67
richard67 - comment - 20 Feb 2016

And the file.php I had modified like you wrote.

avatar richard67
richard67 - comment - 20 Feb 2016

Anyway, I go sleep now. I will check again tomorrow if still necessary.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Feb 2016

i don't have cache lite, but i think you must do a similiar change in this method https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/cache/storage/cachelite.php#L205

avatar richard67 richard67 - test_item - 20 Feb 2016 - Tested successfully
avatar richard67
richard67 - comment - 20 Feb 2016

I have tested this item :white_check_mark: successfully on e44e0e5


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

avatar richard67
richard67 - comment - 20 Feb 2016

I just switched to cache handler = File for the test.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Feb 2016

ok thanks

avatar infograf768 infograf768 - change - 21 Feb 2016
Category Templates (admin) UI/UX Language & Strings Templates (admin) UI/UX
avatar infograf768
infograf768 - comment - 21 Feb 2016

This works fine.
Example of error:
screen shot 2016-02-21 at 10 37 02

avatar infograf768 infograf768 - test_item - 21 Feb 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 21 Feb 2016

I have tested this item :white_check_mark: successfully on e44e0e5


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

avatar infograf768 infograf768 - change - 21 Feb 2016
Status New Ready to Commit
avatar infograf768
infograf768 - comment - 21 Feb 2016

RTC. Thanks.


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

avatar joomla-cms-bot joomla-cms-bot - change - 21 Feb 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Feb 2016
Labels Added: ? ?
avatar brianteeman brianteeman - change - 10 Mar 2016
Milestone Added:
avatar brianteeman brianteeman - change - 22 Mar 2016
Milestone Removed:
avatar brianteeman brianteeman - change - 22 Mar 2016
Milestone Added:
avatar brianteeman brianteeman - change - 22 Mar 2016
Milestone Added:
avatar brianteeman brianteeman - change - 22 Mar 2016
Milestone Removed:
avatar rdeutz rdeutz - reference | 6dc92d0 - 12 Apr 16
avatar rdeutz rdeutz - merge - 12 Apr 2016
avatar rdeutz rdeutz - close - 12 Apr 2016
avatar rdeutz rdeutz - change - 12 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-12 19:24:10
Closed_By rdeutz
avatar andrepereiradasilva andrepereiradasilva - head_ref_deleted - 12 Apr 2016
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar brianteeman brianteeman - change - 11 May 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment