Make scan command more comprehensive and efficient

Created on 12 May 2021, almost 4 years ago
Updated 26 March 2025, 30 days ago

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.

✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇺🇸United States BenStallings

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.71.5 2024