Feature ? PR-4.4-dev Removal Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
4 Apr 2023

Pull Request for pr #40316.

Summary of Changes

It adds a new loadFromCache function in the AbstractModuleDispatcher as replacement for the static ModuleHelper::moduleCache function

Testing Instructions

  • Create some articles
  • Create an instance of the module Articles Category
  • Open the front end

Actual result BEFORE applying this Pull Request

It shows some articles in the module.

Expected result AFTER applying this Pull Request

It shows some articles in the module.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org: joomla/Manual#103

  • No documentation changes for manual.joomla.org needed

346b27b 4 Apr 2023 avatar laoneo cs
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2023
Category Libraries Modules Front End
avatar laoneo laoneo - open - 4 Apr 2023
avatar laoneo laoneo - change - 4 Apr 2023
Status New Pending
avatar laoneo laoneo - change - 4 Apr 2023
Title
Modules/cache/deprecate
Deprecahtes the module cache helper function
avatar laoneo laoneo - edited - 4 Apr 2023
avatar laoneo laoneo - change - 4 Apr 2023
Title
Deprecahtes the module cache helper function
Deprecates the module cache helper function
avatar laoneo laoneo - edited - 4 Apr 2023
avatar laoneo laoneo - change - 4 Apr 2023
Labels Added: PR-4.4-dev
avatar joomdonation
joomdonation - comment - 4 Apr 2023

I don't know how this replacement could be used to cache the output of the whole module in ModuleRenderer here https://github.com/joomla/joomla-cms/blob/4.3-dev/libraries/src/Document/Renderer/Html/ModuleRenderer.php#L83 ?

avatar laoneo
laoneo - comment - 4 Apr 2023

Why not, what is different to what we have now in the abstract class?

avatar joomdonation
joomdonation - comment - 4 Apr 2023

There is no different behavior in the code. However, from what I see, the loadFromCache method from abstract can only be used in the same way with cache callback controller, that is to cache the return values of a method. This works for modules implement it own cache like mod_articles_categories, mod_articles_category, mod_related_items.....

There are other modules which we need to cache it's whole output. That's the logic implemented in ModuleRenderer which I mentioned above. How would you handle that using the new code? Maybe I do not see something ?

Maybe a simple question: How you handle cache for mod_articles_latest use the this replacement?

avatar laoneo
laoneo - comment - 5 Apr 2023

The cache in ModuleRenderer caches the whole output of the module while this one here calls the module and caches only the data. So on some point this caching should be replaced with the one in ModuleRenderer. Means they are completely different.

avatar carlitorweb
carlitorweb - comment - 11 Apr 2023

@laoneo update the module dispatcher (there is already merged code for avoid conflict) for give a test to this PR.

avatar laoneo
laoneo - comment - 12 Apr 2023

Done

avatar carlitorweb carlitorweb - test_item - 13 Apr 2023 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 13 Apr 2023

I have tested this item successfully on e8db14a


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

avatar laoneo laoneo - change - 13 Apr 2023
The description was changed
avatar laoneo laoneo - edited - 13 Apr 2023
avatar drmenzelit drmenzelit - test_item - 13 Apr 2023 - Tested successfully
avatar drmenzelit
drmenzelit - comment - 13 Apr 2023

I have tested this item successfully on f301c61


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

avatar Fedik
Fedik - comment - 13 Apr 2023

I am sorry to say,
We cannot deprecate ModuleHelper::moduleCache because it actively used for module caching, when global cache is enabled.

$module->content = ModuleHelper::moduleCache($module, $params, $cacheparams);

Additionally loadFromCache introduce a large code duplication.
It does not looks right to me.

avatar laoneo laoneo - change - 9 Jun 2023
The description was changed
avatar laoneo laoneo - edited - 9 Jun 2023
avatar laoneo laoneo - change - 26 Jun 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-06-26 11:25:35
Closed_By laoneo
Labels Added: Feature ? Removal
avatar laoneo laoneo - close - 26 Jun 2023

Add a Comment

Login with GitHub to post a comment