preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated

Created on 21 October 2022, about 2 years ago
Updated 24 July 2024, 5 months ago
πŸ› Bug report
Status

Fixed

Version

2.1

Component

Placeholderresolver

Created by

πŸ‡¨πŸ‡¦Canada sagesolutions

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

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.

  • πŸ‡ΊπŸ‡¦Ukraine shoroshanska

    Setup: D10.0.0, PHP 8.1.9, typed_data 8.x-1.x-dev

    I am getting this error after applying the patch #5 β†’ :
    TypeError: Drupal\typed_data\PlaceholderResolver::replacePlaceHolders(): Argument #1 ($text) must be of type string, null given, called in modules/contrib/rules/src/Plugin/RulesDataProcessor/TokenProcessor.php on line 72 in Drupal\typed_data\PlaceholderResolver->replacePlaceHolders() (line 166 of modules/contrib/typed_data/src/PlaceholderResolver.php).

    The patch #2 β†’ solves the issue for me. And there are no errors in the log.

  • πŸ‡ΊπŸ‡ΈUnited States aitala

    Hi,

    I have the same issue with patch #5 and patch #2 works.

    I think #5 is causing an issue with the Rules module (in this case Rules 8.x-3.x-dev (2022-Jun-18) )

    [24-Feb-2023 08:19:49 America/New_York] TypeError: Drupal\typed_data\PlaceholderResolver::replacePlaceHolders(): Argument #1 ($text) must be of type string, null given, called in /home/ipmsusa3/public_html/drupal9/modules/contrib/rules/src/Plugin/RulesDataProcessor/TokenProcessor.php on line 72 in /home/ipmsusa3/public_html/drupal9/modules/contrib/typed_data/src/PlaceholderResolver.php on line 168 #0 /home/ipmsusa3/public_html/drupal9/modules/contrib/rules/src/Plugin/RulesDataProcessor/TokenProcessor.php(72): Drupal\typed_data\PlaceholderResolver->replacePlaceHolders(NULL, Array)
    #1 /home/ipmsusa3/public_html/drupal9/modules/contrib/rules/src/Context/ContextHandlerTrait.php(320): Drupal\rules\Plugin\RulesDataProcessor\TokenProcessor->process(NULL, Object(Drupal\rules\Context\ExecutionState))
    #2 /home/ipmsusa3/public_html/drupal9/modules/contrib/rules/src/Context/ContextHandlerTrait.php(297): Drupal\rules\Plugin\RulesExpression\ActionExpression->processValue(NULL, Array, Object(Drupal\rules\Context\ExecutionState))
    #3 /home/ipmsusa3/public_html/drupal9/modules/contrib/rules/src/Context/ContextHandlerTrait.php(83): Drupal\rules\Plugin\RulesExpression\ActionExpression->processData(Object(Drupal\rules\Plugin\RulesAction\SystemEmailToUsersOfRole), Object(Drupal\rules\Context\ExecutionState))

    Thanks,
    Eric

  • πŸ‡ΊπŸ‡ΈUnited States jsutta United States

    #2 worked for me in Drupal 9.5.4 with Rules 8.x-3.0-alpha7. Because I have the Rules module installed I avoided #5 just in case based on the feedback from others.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 9 months ago
    72 pass
  • πŸ‡΅πŸ‡¦Panama gtoyloy18

    Hi, I tried a couple of this patches but they didn't work as expected.
    Also y had issues with the deprecated str_replace() passing null to parameter #3.

  • First commit to issue fork.
  • Merge request !9Apply patch β†’ (Closed) created by phthlaap
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    71 pass
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Status changed to Fixed 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Fixed by the commit in πŸ“Œ [meta] Add scalar type hinting and return value typing Fixed . The solution was as in #5 - use parameter and return type hints to enforce values being passed to the placeholder resolver.

    The related issue in Rules will be fixed in the Rules issue queue.

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

Production build 0.71.5 2024