Skip to content

[5.4] Remove use of deprecated dispatcher from the plugin constructors #45644

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 36 commits into from
Aug 22, 2025

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Jun 23, 2025

Summary of Changes

Follow up for

PR removes use of the dispatcher argument from plugin constructors.

Testing Instructions

Code review.
Or
Check existing features works as before:
Create/edit Article
Create/edit Category
Create/edit custom field
Run Finder indexer
etc.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works

Link to documentations

Please select:

brbrbr added a commit to brbrbr/Blc that referenced this pull request Jun 23, 2025
@ceford
Copy link
Contributor

ceford commented Jul 22, 2025

On my J5 test installation I get an error on applying the patch that mentions compat6:

The file marked for modification does not exist: plugins/behaviour/compat6/services/provider.php

So I tried on my J6 test installation, where I get:

The file marked for modification does not exist: plugins/behaviour/compat/services/provider.php

These are clones with the appropriate branch checked out and testing data installed.

These files do exist! What now?


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

@brianteeman
Copy link
Contributor

How are you applying the patch?

@ceford
Copy link
Contributor

ceford commented Jul 22, 2025

With Patchtester

@brianteeman
Copy link
Contributor

I doubt that you can use patchtester for this as there are too many files.

@exlemor
Copy link

exlemor commented Aug 1, 2025

I have tested this item ✅ successfully on d2b3978

I have tested this successfully (via the Full Download package).


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

@richard67
Copy link
Member

@Fedik PHPstan fails due to some $plugin->setDispatcher($container->get(DispatcherInterface::class)) statements which you have added for b/c reason, I think:

Call to deprecated method setDispatcher() of class Joomla\Plugin\Editors\None\Extension\None:
5.2 will be removed in 7.0
             Plugin should implement DispatcherAwareInterface on its own, when it is needed.

I'm not sure if we should add new entries to the baseline file for that or if we better should add rules to the main config file like I did with my PR #45814 .

We should discuss that in the maintainers team.

@Fedik
Copy link
Member Author

Fedik commented Aug 3, 2025

I think we can add it to baseline.
This method is overriden in these plugins (I mean does not use CMSPlugin::setDispatcher() version) but PHPstan do not see it.

I will update it later.

@Fedik
Copy link
Member Author

Fedik commented Aug 4, 2025

@richard67 what did you made in other PR to fix phpstan?
I got the same problem again: locally runs fine but github job is crashing.
I tried clear-result-cache, but still the same

@richard67
Copy link
Member

@richard67 what did you made in other PR to fix phpstan? I got the same problem again: locally runs fine but github job is crashing. I tried clear-result-cache, but still the same

@Fedik I had compared the created baseline file with the one from a clean, current 5.4-dev branch and found one entry missing in the created one, so I have added that from the 5.4-dev branch. No idea why phpstan did not add it to the baseline file when creating it.

@richard67
Copy link
Member

@Fedik P.S.: I have no idea why entries from the 5.4-dev phpstan baseline file are missing when a branch of a PR is up to date with the 5.4-dev branch. Something is weird, but for sure it is not caused by your PR.

@Fedik
Copy link
Member Author

Fedik commented Aug 4, 2025

Seems works now, thanks!
Yea, something strange with that. Maybe something with different php versions

@HLeithner
Copy link
Member

I have tested this item ✅ successfully on d2b3978

Full code review


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

@richard67
Copy link
Member

I have tested this item ✅ successfully on d2b3978

Code review of all changes.


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

@richard67
Copy link
Member

RTC


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

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

muhme commented Aug 22, 2025

✅ Final test before merge, with JBT graft

  • Enabled 'Debug System' and 'Log Almost Everything'
  • Created, featured and edited articles in backend; shown and edited in frontend
  • Created category and assigned to articles
  • Created custom fields text and colour, edited in backend and frontend
  • Running Smart Search > Index and Smart Search > Maintenance > Optimise / Clear Index
  • Created and edited contacts, uploaded images and assigned to contacts
  • Rotated, croped, resizes
  • Created Newsfeed, Created Feed Display module and placed on sidebar-right
  • Installed zitat-service.de module from JED Web, configured and placed on banner position
  • Tested language overwrite
  • Visited all tabs in System and Global Configuration, sent test email, cleared cache, updated database structure
  • Visited all tabs in user > edit profile
  • Hided or archived installation messages
  • Running through 'Welcome to Joomla!' guided tour, created a tag with guided tour
  • Tested logout from backend and frontend, tested remember me on frontend
  • Tested run tasks
  • Checked Joomla log files, checked PHP error log, found only one PHP warning (but, this source code file has not been changed):
[Fri Aug 22 12:23:59.972666 2025] [php:warn] [pid 106:tid 106] [client 192.168.65.1:21468] PHP Warning:  Undefined array key 0 in /var/www/html/libraries/src/Table/Nested.php on line 1335, referer: http://localhost:7054/administrator/index.php?option=com_content&view=article&layout=edit&id=2

@brianteeman
Copy link
Contributor

@muhme there is a pr for that error from me.

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

muhme commented Aug 22, 2025

Thank you @Fedik for your contribution. Thank you @brianteeman and @ceford for suporting this PR. Thank you @exlemor, @HLeithner and @richard67 for testing/reviewing.

@Fedik Fedik deleted the plugin-remove-deprecated-dispatcher branch August 22, 2025 13:24
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.

9 participants