Problem/Motivation

Currently the drush whatlinkshere:scan command only scans nodes, and it does so by loading all of the site's node IDs into a batch service that then processes the nodes individually, considering whether or not to process each field on each node one at a time, which is very inefficient for large sites.

Proposed resolution

Rewrite the scan command so that for each supported entity type, it considers each of the fields, and if a field is in the types_of_interest, batches the field table to be processed all at once, querying for links in the field values without loading the individual node entities. For example, the node__body table would be queried for links, but a date field on nodes would be skipped because it can never contain links.

Remaining tasks

Write a new batch service that processes field tables instead of nodes. Rewrite the scan command to determine which field tables need to be processed (and how: entity_reference, text, or link?) and put them in the batch.

User interface changes

Replace the --nid=node_id parameter with --type=entity_type and --id=entity_id.

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

BenStallings created an issue. See original summary.

benstallings’s picture

Issue summary: View changes

johan.gant made their first commit to this issue’s fork.

johan.gant’s picture

A long time coming, but there's a MR pending which fixes the poor batch handling of the module's scan command. If I get enough time to do it I'll look at extending it further to make it configurable to scan specific entity types as well.

https://git.drupalcode.org/project/whatlinkshere/-/merge_requests/9

johan.gant’s picture

Status: Active » Fixed

Changes merged into 2.x with 4f9ee865.

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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