If we create a Multichoice question and leave the "Feedback if chosen" text empty and we submit the quiz result we got the following error:

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\filter\Element\ProcessedText::preRenderText() (line 101 of core/modules/filter/src/Element/ProcessedText.php).

Issue fork quiz-3308523

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rhristov created an issue. See original summary.

rhristov’s picture

StatusFileSize
new1.53 KB
m.georgiev’s picture

Status: Active » Needs review

Tested and works!

alayham’s picture

Status: Needs review » Reviewed & tested by the community

Tested #2 on the current dev branch, the error message disappeared.

avpaderno’s picture

Title: Deprecated function: str_replace() » str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in ProcessedText::preRenderText()

  • rhristov authored b819a021 on 6.x
    Issue #3308523 by rhristov: str_replace(): Passing null to parameter #3...
djdevin’s picture

Version: 6.0.0-alpha7 » 6.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks, fixed.

Status: Fixed » Closed (fixed)

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

altrugon’s picture

StatusFileSize
new1.37 KB

Hello there:

Apologies in advance if this is already fixed as the comment #7 claims, but I have just checked out branch 6.x-dev at commit b6ba46afa8c93cf814caa0caa5a033a1ff4f2df1 and I don't see the patch applied. That's why I have created a new patch against this commit.

Cheers.

Ron Collins made their first commit to this issue’s fork.

avpaderno’s picture

Commit b819a021 does apply those changes.

ron collins’s picture

We needed this patch against 6.x-alpha7 to prevent the error on php 8.1. I assume it will be helpful for others that don't want to move to the dev branch.

Sorry about the extraneous issue branch. I didn't think about the fact that I couldn't create the MR against the tag.

ron collins’s picture

Jesus, rough morning. Looks like I made that patch off the wrong branch.
Hopefully this one is better.