Redirect loop error when re-saving node with existing redirect

Created on 7 December 2018, over 5 years ago
Updated 4 April 2024, 3 months ago

We have a site with migrated content. When we migrated the content from D7 site, we created redirects from the path on the old site to the node on the new site - in case the paths were not the same. For example, redirect from /document/league-women-voters to /node/6271. Things have been working fine with no redirect loops (even when old website path and new website URL alias are the same) until we open one of these old migrated nodes and attempt to change it's title. If I change the title of the node to that it's new url would be /document/foo and save, I often see the following error:

The website encountered an unexpected error. Please try again later. Drupal\Core\Entity\EntityStorageException: Redirect loop identified at
/document/league-women-voters for redirect 2268 in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
(line 783 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\redirect\RedirectRepository->findByRedirect(Object, 'en') (Line: 93)
Drupal\redirect\RedirectRepository->findMatchingRedirect('document/league-women-voters', Array, 'en') (Line: 109)
redirect_path_update(Array)'

The error doesn't happen 100% of the time on every node. But when it does, it is a WSOD and sometimes it appears that the document title does get changed, but there is no revision history and clearing the cache causes the change to revert.

πŸ› Bug report
Status

Needs work

Version

1.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nrackleff

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024