Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Plugin filter process method actually return string.
This generate an error since plugin process should return \Drupal\filter\FilterProcessResult
.
To reproduce, enable prism filter in a format and save a content with this format. The error will occur.
Proposed resolution
plugin process should return \Drupal\filter\FilterProcessResult
.
Comment | File | Size | Author |
---|---|---|---|
#4 | plugin_filter_process-2678016-4.patch | 1.88 KB | GoZ |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Centarro commentedComment #3
GoZ CreditAttribution: GoZ commentedHere is a path to fix this issue.
Comment #4
GoZ CreditAttribution: GoZ as a volunteer commentedI also add here libraries.
I cannot make another issue since we use FilterProcessResult to add libraries.
So the attached patch is same as comment #3 with libraries (based on fact css and js files are in sites/all/libraries/prism as defined in README.txt)
Comment #5
rooby CreditAttribution: rooby commentedI'm using this patch for the libraries addition and it is working as expected.
From a coding standards point of view the patch is fine too.
I'm not currently using the prism filter though so I haven't actually done testing on that aspect.
Comment #6
GoZ CreditAttribution: GoZ as a volunteer commentedComment #7
scuba_flyConfirming #4 works.
This could also work:
$text->setProcessedText(str_replace($search, $replace, $text->getProcessedText()));
if you replace the line
return str_replace($search, $replace, $text);
with above in PrismFilter.phpComment #8
moonray CreditAttribution: moonray at Chapter Three commentedThe patch in #4 fixes a critical error. I didn't try the suggestion in comment #7.
Comment #9
Chroid CreditAttribution: Chroid at Sparks Interactive commentedI can also confirm I'm receiving this error after a initial install and enabling of the module:
Applying @GoZ's patch from #4 resolves these issues immediately.
Should/could this be committed against dev so that every new install isn't killing people's sites as soon as it's enabled and used ?
Comment #10
MykolaVeryha CreditAttribution: MykolaVeryha commentedComment #11
DuaelFrNice job here!
Can we get it commited and have a new release to celebrate? <3
Comment #12
eojthebraveIt looks like this was resolved in the 8.x-1.0 branch at some point in the past.
And is also resolved in the 2.0.x branch. So I'm going to go ahead and close this issue. Thanks everyone.
Comment #13
eojthebrave