Skip to content

[5.4] Model\AfterCleanCacheEvent event class is not forced for onContentCleanCache events #45713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 23, 2025

Conversation

Denitz
Copy link
Contributor

@Denitz Denitz commented Jul 10, 2025

Summary of Changes

BaseDatabaseModel uses Model\AfterCleanCacheEvent event class to dispatch default onContentCleanCache event.

But this event class is not registered for this event name.

Hence, old-style (legacy) dispatching like:

$options = array(
    'defaultgroup' => 'com_plugins',
    'cachebase' => $jconf->get('cache_path', JPATH_SITE . '/cache')
);
$app->triggerEvent('onContentCleanCache', $options);

will use default Event class, while for consistency, we should have Model\AfterCleanCacheEvent class.

Testing Instructions

Register own listener for onContentCleanCache event using Model\AfterCleanCacheEvent param class:

public function onContentCleanCache(Model\AfterCleanCacheEvent $event)

Execute old-style event dispatch without event instance like above.

Actual result BEFORE applying this Pull Request

See invalid param type error, $event is instance of Event class.

Expected result AFTER applying this Pull Request

No errors, the $event is instance of Model\AfterCleanCacheEvent.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@Denitz Denitz changed the title Model\AfterCleanCacheEvent event class is not forced for onContentCleanCache events [5.3] Model\AfterCleanCacheEvent event class is not forced for onContentCleanCache events Jul 10, 2025
@Fedik Fedik added the bug label Jul 10, 2025
@Denitz
Copy link
Contributor Author

Denitz commented Aug 21, 2025

@Fedik Should I rebase it to 5.4, or 6.0?

@Fedik
Copy link
Member

Fedik commented Aug 21, 2025

Please rebase to 5.4

@Denitz Denitz changed the base branch from 5.3-dev to 5.4-dev August 21, 2025 15:49
@Denitz Denitz changed the title [5.3] Model\AfterCleanCacheEvent event class is not forced for onContentCleanCache events [5.4] Model\AfterCleanCacheEvent event class is not forced for onContentCleanCache events Aug 21, 2025
@Denitz
Copy link
Contributor Author

Denitz commented Aug 21, 2025

Done.

@Fedik
Copy link
Member

Fedik commented Aug 22, 2025

I have tested this item ✅ successfully on 8883ae8


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

@richard67
Copy link
Member

I have tested this item ✅ successfully on 8883ae8

Tested by code review.


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 22, 2025
@richard67
Copy link
Member

I don't think it needs real tests which require some coding as it is a no-brainer.

@richard67 richard67 added this to the Joomla! 5.4.0 milestone Aug 22, 2025
@muhme muhme merged commit 027053d into joomla:5.4-dev Aug 23, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 23, 2025
@muhme
Copy link
Contributor

muhme commented Aug 23, 2025

Thank you @Denitz for your contribution. Thank you @Fedik and @richard67 for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants