Closed (fixed)
Project:
Search and Replace Scanner
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2021 at 20:48 UTC
Updated:
1 Apr 2026 at 10:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaComment #3
damienmckennaWe'll need to include test coverage for this.
Comment #4
damienmckennaThere's another issue for this that has a patch/merge request, so let's close this one and work on the other one.
Comment #5
hemangi.gokhaleThis issue is still reproducible. As Stephen mentioned in #3196225, I updated the module to 2.0.x version, using Drupal 10.6.2. Here is what the error trace looks like:
I believe we need to add null or empty checks to avoid errors when processing Scanner results. The main issues are:
1. Match count increments in ScannerForm fail when $data['field'] is empty
2. Regex processing in the Node scanner does not validate $matches[0] before accessing it
3. Paragraph scanner does not safely handle orphaned paragraphs or nested entity hierarchies
Comment #7
hemangi.gokhaleAttached is the MVP patch that ensures null checks are added before processing field data, regex matches, and handling orphaned paragraphs, and that safely traverses nested entity parents. This issue now needs tests.
Comment #8
damienmckennaThank you for the merge request.
Comment #9
damienmckennaComment #10
damienmckennaRelated issue: #3196119: Errors on search-only for deep-nested paragraphs
Comment #11
hemangi.gokhaleI've added the testcases. Thank you!
Comment #13
damienmckennaCommitted. Thank you!