Problem/Motivation
This issue is a break down of its parent task #3565209: [Meta] Drop support for Drupal 10.2 and below so that its merge request could be broken down into smaller pieces.
This is the key BC breaking issue of #3565206: [Meta] Roadplan for Admin Toolbar 3.6.x and 3.7.x:
With the recent release of D11.3.0, we should be looking at creating a new LTS support minor release which will be compatible with D12.
In which case, we would be dropping support for core versions below 10.3 and thus drop support for D9.5:
Currently: ^9.5 || ^10 || ^11
Proposed: ^10.3 || ^11
This would allow us to start modernizing module's code base and leverage more recent versions of PHP and Drupal Core APIs.
Steps to reproduce
Proposed resolution
Changing the version to 10.3 minimum would imply PHP 8.1 minimum, see:
https://www.drupal.org/docs/getting-started/system-requirements/php-requ...
As per change record: Drupal 10 minimum PHP requirement raised to PHP 8.1.
Among some of the changes expected:
- Remove BC (backward compatibility) code: search for occurrences of
\Drupal::VERSION - Use PHP Attributes where possible
- Fix missing return types (void)
- More changes to be added...
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork admin_toolbar-3569351
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dydave commentedQuick follow-up on this issue:
Created initial merge request !202 above at #2 which should complete the first step towards dropping support for D10.2 and below:
It contains the bare minimum, with the changes to the core version requirements and the removal of all the version_compare code for backward compatibility.
But also a few additional changes:
The Admin Toolbar Links Access Filter module can't be just removed like that from the code base....
Because users upgrading from versions lower than 10.3 might still have the module enabled.
Therefore if the module is removed from the code base it will most likely create issues for uninstalling the module.
The Admin Toolbar Links Access Filter module will have to be removed after the Admin Toolbar module has dropped support for versions lower than 10.3.
So the module will still need to be kept in the next 3.7 minor release and should be removed in the following one (maybe 3.8?!), which should probably have some kind of version constraint preventing a direct update from versions lower than 3.7 (?!).
This should prevent from having issues with sites running db updates (upgrading), unable to uninstall the module since it would have been removed from the code base.
But for the time being: All the code of the module file was removed.
Renamed the admin_toolbar_tools module library
toolbar.icontoadmin_toolbar_tools.Moved constants class
AdminToolbarToolsConstantsback under the tests folder since it now seems to be supported.Added missing return types to functions where possible.
Refactored CSS file
admin_toolbar.sticky_behavior.cssto use cascading style.Since all the jobs and tests are still passing 🟢, moving issue to Needs review for now, as an attempt to get more testing feedback and code reviews.
Feel free to let us know if you have any questions or concerns on any of the suggested code changes or this issue in general, we would surely be happy to help.
Thanks in advance! 😊
Comment #4
dydave commentedFollowing the plan outlined at #3565206-30: [Meta] Roadplan for Admin Toolbar 3.6.x and 3.7.x, the first step towards the next 3.7.0 would be to get this merged in 3.x.
The MR was rebased and is ready to be reviewed/merged.
We should not remove completely the
admin_toolbar_links_access_filtermodule yet in this release, but keep it as a stub module so it could be properly uninstalled on all sites after they update and prevent prompting missing module errors.Once this is merged we should be able to create the follow up issue:
Add support for Drupal 12
Comment #6
dydave commentedMerged, thanks a lot to everyone who followed and helped on this issue! 🙏
This is the key BC-breaking step of #3565209: [Meta] Drop support for Drupal 10.2 and below and #3565206: [Meta] Roadplan for Admin Toolbar 3.6.x and 3.7.x: Admin Toolbar now drops support for Drupal core versions lower than 10.3. All the modules now declare
core_version_requirement: ^10.3 || ^11.Summary of the changes
\Drupal::VERSIONchecks, Symfony 4.4 request type constants, test workarounds).admin_toolbar_update_8006(), uninstalls it automatically (with a test). The stub will be removed in a future release.toolbar.icontoadmin_toolbar_tools.ToolbarController: added return types and a shared redirect helper (reloadPage()is no longer public), and replaced the functions deprecated in Drupal 11.5 (drupal_static_reset()andviews_invalidate_cache()) by their replacements on 11.5 and above, without ignoring the PHPStan errors.AdminToolbarToolsConstantsclass under the tests folder and added missing return types.Upgrade notes: sites should update to the release containing this change and run the database updates (
drush updb) before upgrading further, so the Links Access Filter module gets uninstalled. Third-party code attaching theadmin_toolbar_tools/toolbar.iconlibrary or extendingToolbarControllermight need to be adjusted.Next steps
Now that this issue is fixed, we can move forward with the related issues and add support for Drupal 12 (
^10.3 || ^11 || ^12), see #3594696: Add support for Drupal 12 and the other issues in the meta #3565206: [Meta] Roadplan for Admin Toolbar 3.6.x and 3.7.x. This will also include reverting theprovideworkaround added in #3630983: Cannot update to latest 11.3.x or 10.6.x core version due to impossible drupal/toolbar dependency and adding the dependency to the contrib Toolbar module, so the module can be used with Drupal 12.Thanks again! 😊
Comment #8
ressaThanks for keeping Admin Toolbar in good shape @dydave!
Comment #9
dydave commentedThanks @ressa! 🥳
Who would have thought this MR would have finally landed?! 😅
It was created 9-10 months ago... it was a really long shot 🤩
Looks like we're finally going to be able to cleanup module's code! \o/
We should be able to have a new 3.7.0 D12 compatible version very soon 🤞
Comment #10
ressaSounds fantastic! That's a pretty big MR, with lots of old code getting removed, and other code updated, very nice. It's also great to see all the new issues about improving accessibility, fixing translation trouble, etc. Admin Toolbar 3.7 will be a great release!