Add token-based extraction, joiner configuration, and improved RegEx extraction

Created on 11 December 2024, 2 months ago

Problem/Motivation

The module currently only handles direct RegEx extraction from a single field value and does not integrate smoothly with Drupal tokens. Additionally, the configuration forms for RegEx extraction rules are limited, making it difficult to manage multiple matches or combine results.

Proposed resolution

  1. Enhanced Field Handling:
    • Change the field_rule from string to string_long for more flexibility in storing larger, multi-line text content.
    • Refactor and streamline form configuration:
    • Introduce extraFormFields() to define the RegEx input field (automator_extractor_regex).
    • Update extraAdvancedFormFields() to add a joiner configuration field, allowing multiple extracted values to be combined into a single string.
  2. Token-Based Extraction Support:
    • Add a new TokenHelper utility class to extract values from entity fields based on provided tokens.
    • When mode is token and the token module is enabled, the extractor replaces tokens like [node:field_tags] with their corresponding field values before applying the RegEx extraction.
  3. Improved Extraction Logic:
    • Introduce a helper method (addMatches()) to handle multiple RegEx matches more robustly, filtering out empty values.
    • Allow for joining multiple extracted results using a configurable delimiter, enabling more user-friendly output.
🌱 Plan
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom seogow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024