? Pending

User tests: Successful: Unsuccessful:

avatar sourcecoast
sourcecoast
3 Sep 2020

Issue:
When caching is enabled, changes to administrator modules require manually clearing cache before the change is applied.

Underlying Cause:
The /administrator/components/com_modules/models/module.php file uses an overridden cleanCache function which tries to guess whether the front-end or admin com_modules cache should be cleaned. That function calls $this->getClient() which uses a private variable ($_clientId) which is never set. Therefore, the local cleanCache always clears the front-end module cache even if an administrator module is being edited.

Fix:
Remove the erroneous and otherwise unused getClient function
Update the cleanCache function to always clear the front-end and administrator com_modules cache.

Possible improvements:
Since the front-end modules are primarily what users edit, this adds a little overhead to clear admin modules everytime. However, it should have no impact on the site overall. The code could be implemented to properly determine the module type being edited and only clear that cache, but I wanted this change to be as surgical as possible.

Testing:
Enable caching in the Global Configuration - I was using File / Conservative, but I believe any caching will exhibit this problem
Edit an admin module - Title, published state or any setting
The changes should be immediately visible

avatar sourcecoast sourcecoast - open - 3 Sep 2020
avatar sourcecoast sourcecoast - change - 3 Sep 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Sep 2020
Category Administration com_modules
avatar Kostelano
Kostelano - comment - 3 Sep 2020

Issue #30492

avatar alzander alzander - change - 3 Sep 2020
Labels Added: ?
avatar alikon
alikon - comment - 3 Sep 2020

1st of all thank you for your 1st pr
i would like to clean the cache selectively i.e if i'm updating an admin module then only the admin module cache should be cleaned and viceversa

avatar sourcecoast
sourcecoast - comment - 3 Sep 2020

1st of all thank you for your 1st pr
i would like to clean the cache selectively i.e if i'm updating an admin module then only the admin module cache should be cleaned and viceversa

I agree that would be 'better'. The reasons I didn't is because it's more difficult to get that right and test. For editing/saving one module, it's not terribly troublesome since we can ask "Are you an admin or front-end module" and simply clear that.

When you add in batch copying/moving or group publishing, then we need to loop over each module and set a flag for if any were front-end or admin. Definitely do-able, but I don't have the time to implement that and test right now, so I put this in.

The current method is 100% broken though and goes back to how this file was updated in 2011.. so this is an improvement :)

As noted above:

  • Currently, when editing any module (front or admin) the front-end modules are all flushed.
  • With this PR, when editing any module, both front and admin are flushed
  • Since front-end modules are much more commonly edited, this means we're only adding some overhead of flushing the admin modules (which are used less frequently and regenerating their cache is unlikely to be a server load).
  • This shouldn't have any additional negative impact on the front-end, but could be improved by not flushing the front-end cache when admin modules are edited in the future.

Let me know. If this can't be integrated as-is, I can gladly investigate the improvements, but I don't know when they'd be implemented.

avatar adj9
adj9 - comment - 5 Sep 2020

I tried PR with Joooml!'s default modules 3.9.21.
I don't find any problem in changing the features of the modules with active cache.
The cache is not full, I have enabled it for this PR.


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

avatar sourcecoast
sourcecoast - comment - 8 Sep 2020

I tried PR with Joooml!'s default modules 3.9.21.
I don't find any problem in changing the features of the modules with active cache.
The cache is not full, I have enabled it for this PR.

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

Thanks for testing! I'm glad to hear this PR worked for you.

avatar gostn gostn - test_item - 10 Oct 2020 - Tested successfully
avatar gostn gostn - test_item - 10 Nov 2020 - Not tested
avatar HLeithner
HLeithner - comment - 10 Nov 2020

@gostn stop spamming our tracker with useless actions, if you continue you will be blocked.

avatar HLeithner
HLeithner - comment - 10 Nov 2020

Every time you do this (which makes no sense to me anyway) hundreds of people get notifications and that's annoying. So please stop it and if you don't want to contribute any longer I sorry for this but can't change it.
So please don't flood us with unneeded notifications.

avatar zero-24 zero-24 - change - 21 Jul 2022
Labels Added: ?
Removed: ?
avatar zero-24
zero-24 - comment - 21 Jul 2022

@sourcecoast I'm sorry that it took that long to come back to this but I will take this here into 3.10.11 (after drone passes) so after a few days more than usually (:D) that issue is finally fixed. Thanks

avatar zero-24
zero-24 - comment - 3 Aug 2022

I have put more thourth into this and decided to not merge this change into the very last 3.10 release and will limit it to the absolute required changes nessesarry.

avatar zero-24 zero-24 - close - 3 Aug 2022
avatar zero-24 zero-24 - change - 3 Aug 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-08-03 18:44:10
Closed_By zero-24

Add a Comment

Login with GitHub to post a comment