- Issue created by @project update bot
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module β these changes make this module compatible with Drupal 11! π
Therefore these changes update theinfo.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot β to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
Bot run #11-127659These packages were used to generate the fixes:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.9
- palantirnet/drupal-rector: 0.20.1
- πΊπΈUnited States nathanraystone
Adds a few more D11 compatibility updates.
- π¨π¦Canada joelpittet Vancouver
@nathanraystone would it be possible you could roll those changes into the Merge Request instead of a patch? And do you think that change will make D11 incompatible with previous versions of Drupal? In that case maybe this should be moved to a 4.x
- πͺπΈSpain albeorte
albeorte β changed the visibility of the branch project-update-bot-only to hidden.
- πͺπΈSpain albeorte
albeorte β changed the visibility of the branch 3433980-automated-drupal-11 to hidden.
- Merge request !38Issue #3433980 by nathanraystone: Drupal 11 compatibility fixes β (Open) created by albeorte
- πͺπΈSpain albeorte
Hi,
I have created a Merge request !38 with the changes integrated in comment #4 by @nathanraystone.
The changes have been tested and work correctly for Drupal 10 and 11 (even in Drupal 9, reviewing the code, as it acts the same way in class inheritance).
So @joelpittet, it is not incompatible with older versions of Drupal.
Prevnext works as expected, please merge and release it compatible with Drupal 11.
Thanks in advance
- π¨π¦Canada joelpittet Vancouver
Thanks @albeorte, I wonder how you tested that, it's a class
__construct
change that will have a regression
see this issue π [regression] The new property \Drupal\Core\Form\ConfigFormBase::$typedConfigManager conflicts with some contrib modules FixedGiven this Change Record https://www.drupal.org/node/3404140 β we have a few options:
- Create a new branch 4.x for Drupal core >=10.2
- Set the minor version on 3.1.x to require Drupal core >=10.2
Setting to needs work because the base class constructor is not called any more in that, and so the config manager is not being set.
- π¨π¦Canada joelpittet Vancouver
joelpittet β changed the visibility of the branch 3.0.x to hidden.
- Status changed to Needs work
21 days ago 3:20pm 8 July 2025 - πͺπΈSpain albeorte
Hi @joelpittet,
With the changes included in the merge request I created, originally written by @nathanraystone as a classic patch, the module is fully functional in Drupal 10 and 11 (and even in Drupal 9, based on the code review, since class inheritance behaves the same way there).
The code and its functionality have been reviewed.Regarding the issue you mentioned and your proposed approach, both alternatives are valid and applicable.
In our specific case, within thePrevNextSettingsForm
class, we are only using the$config_factory
property from the parent class. Therefore, there are two possible ways to address the change:Option A:
Remove the explicit injection of the$config_factory
dependency from thePrevNextSettingsForm
class, as the$this->config()
method we use is already provided via inheritance:
FormBase::config()Option B:
Implement full dependency injection in thePrevNextSettingsForm
class, including both$config_factory
and$typedConfigManager
as explicit class properties.Both approaches are valid. Personally, I don't mind declaring both properties, as it's a pattern also followed in many other contrib modules.
- π¨π¦Canada joelpittet Vancouver
Ah I see, the
\Drupal\Core\Form\ConfigFormBaseTrait::config()
does some jumping through hoops if the config factory is not injected to grab it off the container. It does help if the property is already there, so injecting it seems the way to go from my prospective. - πͺπΈSpain albeorte
The changes with dependency injection have already been included and are ready to be reviewed by the community:
- Merge request: !38
- Patch: https://git.drupalcode.org/project/prevnext/-/merge_requests/38.patch
Ready to check!