Warning: Array to string conversion in Drupal\shortcode\Plugin\Filter\Shortcode->tips() (line 108 of shortcode/src/Plugin/Filter/Shortcode.php)

Created on 23 January 2024, 11 months ago
Updated 24 February 2024, 10 months ago

Problem/Motivation

Got a warning in the log for the shortcode version 2.0.2:
Warning: Array to string conversion in Drupal\shortcode\Plugin\Filter\Shortcode->tips() (line 108 of shortcode/src/Plugin/Filter/Shortcode.php)

Steps to reproduce

Proposed resolution

Use Json::encode if the returned tip is an array

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @wendyZ
  • Created a patch to fix this warning.

  • Status changed to Postponed: needs info 11 months ago
  • 🇭🇺Hungary denes.szabo Hungary

    I have no idea, we have a problem here and it can be solved by a Json:encode.

    Can you specify how I can reproduce this error?

  • Sorry for the late reply. I just saw the update.
    We did many upgrades and code changes since I reported this issue. Now I couldn't reproduce this warning after I revert the patch. So this might be an issue caused by our custom code. It could be our custom code populated the $tip as an array instead of a string.
    You can close the issue.

  • Status changed to Closed: outdated 10 months ago
  • 🇭🇺Hungary denes.szabo Hungary

    Thank you for your update. I am closing it now.

Production build 0.71.5 2024