Problem/Motivation

On Drupal 11.4.0, any request fatals with:

Error: Call to undefined method Drupal\Core\PathProcessor\PathProcessorManager::addInbound() in Drupal\redirect\PathProcessor\RedirectPathProcessorManager->addInbound() (line 39 of modules/contrib/redirect/src/PathProcessor/RedirectPathProcessorManager.php).

Drupal 11.4 rewrote Drupal\Core\PathProcessor\PathProcessorManager to use constructor-injected autowired iterators (#[AutowireIterator(tag: 'path_processor_inbound')] / path_processor_outbound) and REMOVED the addInbound() / addOutbound() service-collector methods (and getInbound()). RedirectPathProcessorManager extends that manager, overrides addInbound() calling parent::addInbound() (now undefined) and iterates via getInbound() in processRedirectInbound() — both gone — so it fatals. The module's redirect.services.yml also still registers via { name: service_collector, tag: path_processor_inbound, call: addInbound }.

Steps to reproduce

  1. Install Drupal 11.4.0 with the Redirect module (8.x-1.x) enabled.
  2. Load any page. The site returns HTTP 500 with the fatal above.

Proposed resolution

Follow core 11.4's pattern in RedirectPathProcessorManager: inject the inbound/outbound processors via constructor #[AutowireIterator(tag: 'path_processor_inbound')] / path_processor_outbound and call parent::__construct(); remove the addInbound() override and the registration-time applies() gating; in processRedirectInbound() iterate $this->inboundProcessors, skipping PathProcessorFiles (and AliasPathProcessor when $skip_alias). Update redirect.services.yml to autowire: true with $config_factory: '@config.factory' and drop the service_collector tag. Needs to stay compatible with Drupal 10.4/10.5 as well (the removed methods still exist there), so the change should be guarded or the module's minimum core raised accordingly. See the issue fork and merge request !199 linked on this issue.

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • N/A

API changes

  • Drupal core 11.4 removed PathProcessorManager::addInbound()/addOutbound()/getInbound(); this fix aligns RedirectPathProcessorManager with the new autowired-iterator pattern instead of the removed service-collector methods (module-internal, not a Redirect module public API change).

Data model changes

  • N/A

Release notes snippet

  • fix: Fix Drupal 11.4 compatibility for RedirectPathProcessorManager (PathProcessorManager::addInbound() removed)

Issue fork redirect-3607821

Command icon 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

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
berdir’s picture

Status: Active » Postponed (maintainer needs more info)

redirect.module doesn't have a RedirectPathProcessorManager, this MR adds that. You might be using a patch?

rajab natshah’s picture

Thanks, Sascha, for passing by this issue
You are right.

#2879648: Redirects from aliased paths aren't triggered

berdir’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.