Problem/Motivation

With the ability to search link fields being added in https://www.drupal.org/project/scanner/issues/3224980 it would be good to be able to search via path alias, and find the links that use it, as they are not stored as a URL in the database. This would help more inexperienced users who might not know you need to search for the node id and think that the URL is not linked to.

Proposed resolution

Add a new setting for searching via path alias, which when ticked, will change the text that they enter into the search field to the way that it is stored in the database for link fields e.g. convert "/url-alias" into "entity:node/123" and then perform a normal search for that string instead.

We could also make it search the string that they entered without converting it if there are no found path alias for what they entered

User interface changes

New boolean field for searching via path alias on both /admin/config/content/scanner and /admin/content/scanner

Remaining tasks

  • Add the new setting to the two setting forms
  • Make sure search works with the new setting enabled
  • Make sure replace works with the new setting enabled
  • Update/create tests to use the new setting

Issue fork scanner-3580397

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

belazoth created an issue. See original summary.

belazoth’s picture

Issue summary: View changes

I have started a branch that adds the boolean to the two setting forms and the basic logic for changing the entered text from the alias to how it is stored in the database.

damienmckenna’s picture

Status: Active » Needs review

Thank you for the branch, I turned it into a merge request.

I'm not sure this is the correct approach, we need to think it over.

smustgrave’s picture

Status: Needs review » Needs work

Would need test coverage and an update path for sure.