? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
16 Nov 2016

Pull Request for New Issue.

Summary of Changes

After #12671 when you have cache enabled an install a language the language cannot be used until you clean the cache.

This PR intends to solve that.

Testing Instructions

  1. Use latest staging
  2. Enable cache
  3. Install a language and go to installed languages see the installed language is not there.
  4. Clean the cache. the language is there now.
  5. Apply patch
  6. Install a language. Repeat step 3. the language is there.

Documentation Changes Required

None.

avatar andrepereiradasilva andrepereiradasilva - open - 16 Nov 2016
avatar andrepereiradasilva andrepereiradasilva - change - 16 Nov 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Nov 2016
Category Libraries
avatar mbabker
mbabker - comment - 16 Nov 2016

This seems somewhat backward to me. It seems to me this data should be saved to a cache group that gets cleared on extension install/update and if we aren't already doing so there should be "critical" cache groups that are cleared on extension install/update.

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Nov 2016

right, first instinct was to solve the imediate problem and think later ?

anyway in this PR i do the same for the getContentLanguages (which, for now, is only used in associations edit), but those IMO we cannot cache to file (unless we clear the cache everytime we create/delete/change a content language).

so what do you propose, add a cache clean of com_languages everytime a language is installed/removed?
if so, i'm not very confortable with caching mecanisms and JInstaller, could you help pointing the way?

avatar mbabker
mbabker - comment - 16 Nov 2016

At https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_installer/models/languages.php#L257 add a call to JFactory::getCache()->clean('com_languages'); to the end of the method.

Edits to content languages already clear that cache group, see https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_languages/models/language.php#L262

So the part that isn't covered is clearing cache after a regular extension install or update. For install you could do something in https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_installer/models/install.php#L64 but you'd need to figure out what kind of data is available to you to only clear that cache for language packages/extensions. Funny enough, the controller method for that task clears the mod_menu cache always on success. The same applies to the update controller/model as well.

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Nov 2016

thanks a lot! will check that

avatar andrepereiradasilva
andrepereiradasilva - comment - 16 Nov 2016

i think (and hope) in the last comit i cover all installed languages cases.

content languages is another issue, because we need to clean the cache on every action ... even just changing the state of a content language in the list view. so, probably is better not to cache those...

eff02da 17 Nov 2016 avatar andrepereiradasilva cs
avatar andrepereiradasilva andrepereiradasilva - change - 17 Nov 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 17 Nov 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Nov 2016

ok @mbabker since the content languages is already been cached anyway i added it again.
See https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/language/helper.php#L134

please check if we can solve the installed languages cache the way i did it. thanks in advance.

avatar andrepereiradasilva andrepereiradasilva - change - 17 Nov 2016
Title
[Regression] Do not cache to file language queries
[Regression] Do not cache to file installed language query
avatar andrepereiradasilva andrepereiradasilva - edited - 17 Nov 2016
avatar andrepereiradasilva andrepereiradasilva - change - 17 Nov 2016
Title
[Regression] Do not cache to file language queries
[Regression] Do not cache to file installed language query
avatar andrepereiradasilva andrepereiradasilva - change - 17 Nov 2016
Title
[Regression] Do not cache to file installed language query
[Regression] Clean cache of installed language query on language extension install/update/remove
avatar andrepereiradasilva andrepereiradasilva - edited - 17 Nov 2016
avatar andrepereiradasilva andrepereiradasilva - change - 17 Nov 2016
Title
[Regression] Do not cache to file installed language query
[Regression] Clean cache of installed language query on language extension install/update/remove
avatar mbabker
mbabker - comment - 17 Nov 2016

This should work. I can't say that clearing this cache in the install adapters is a good technical solution, but I don't really have anything better for the moment so let's run with it so we don't lose the ability to cache this data.

avatar brianteeman
brianteeman - comment - 5 Dec 2016

I have tested this item successfully on ab7eca4

confirmed issue with cache
applied patch - no issue with cache


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

avatar brianteeman brianteeman - test_item - 5 Dec 2016 - Tested successfully
avatar alikon
alikon - comment - 6 Dec 2016

I have tested this item successfully on ab7eca4


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

avatar alikon alikon - test_item - 6 Dec 2016 - Tested successfully
avatar jeckodevelopment
jeckodevelopment - comment - 6 Dec 2016

I have tested this item successfully on ab7eca4


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

avatar jeckodevelopment jeckodevelopment - test_item - 6 Dec 2016 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 6 Dec 2016
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 6 Dec 2016

RTC


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

avatar jeckodevelopment jeckodevelopment - change - 6 Dec 2016
Milestone Added:
avatar rdeutz rdeutz - reference | 75c2dc7 - 6 Dec 16
avatar rdeutz rdeutz - merge - 6 Dec 2016
avatar rdeutz rdeutz - close - 6 Dec 2016
avatar rdeutz rdeutz - close - 6 Dec 2016
avatar rdeutz rdeutz - merge - 6 Dec 2016
avatar rdeutz rdeutz - change - 6 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-06 22:13:00
Closed_By rdeutz

Add a Comment

Login with GitHub to post a comment