Problem/Motivation

Give me all the redirects to node 123

Proposed resolution

Add a new method ::findByDestinationUri() in the redirect.repository service that allows to pass the destination URI and retrieves a list of redirects redirecting to that URI.

Remaining tasks

None.

User interface changes

None.

API changes

New method: \Drupal\redirect\RedirectRepository::findByDestinationUri().

Data model changes

None.

CommentFileSizeAuthor
#2 2884587-2.patch834 bytesclaudiu.cristea

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Title: Find all redirects give a destination URI » Find all redirects given a destination URI
Status: Active » Needs review
StatusFileSize
new834 bytes

Patch.

michelle’s picture

This new function is working for me. Using it in the patch in #2702353: Vertical tab for listing redirects to content/entities missing

berdir’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I'm not sure I see the benefit of adding this in a separate issue. We'll need tests if we do that. Also we might want to support multiple destinations, nodes can for example by referenced as internal:/node/1 or entity:node/1, depends on how the redirect is created.

claudiu.cristea’s picture

@Berdir,

Also we might want to support multiple destinations, nodes can for example by referenced as internal:/node/1 or entity:node/1, depends on how the redirect is created.

You mean passing the $destination_uri method argument as an array of destination URIs?

mpp’s picture

Status: Needs work » Fixed

As stated in #3: the patch in #2 has already been committed on 2702353 #47.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.