I should have reopened #2884218: Results are cached but I could not. If we look at the code:

 *   cache = FALSE

then

  public function process($text, $langcode) {
    return new FilterProcessResult(php_eval($text));
  }

However, the "cache" attribute was removed in 2014 (in the commit https://cgit.drupalcode.org/drupal/commit/?id=d5be5c0 that added FilterProcessResult). We should do something like this:

  public function process($text, $langcode) {
    $result = new FilterProcessResult(php_eval($text));
    $result->setCacheMaxAge(0);
    return $result;
  }

I'm not posting a patch now because I don't use this module, but custom one with similar issue. We can also add tests.

Comments

jcisio created an issue. See original summary.

hass’s picture

Thanks for sharing this details.

jcisio’s picture

Category: Task » Bug report
StatusFileSize
new1.36 KB

Let's see if it fails.

hass’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB

And now with your bugfix?

Status: Needs review » Needs work
hass’s picture

Branch is green... this would be the last patch before creating final 1.0. Would be great to get in ASAP.

hass’s picture

Status: Needs work » Needs review
StatusFileSize
new1.94 KB
hass’s picture

StatusFileSize
new1.36 KB

Re-uploding the test-only that had a bug.

The last submitted patch, 3: php-2979319-cache-3-testonly.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 8: php-2979319-cache-3-testonly.patch, failed testing. View results

  • hass committed 172fe36 on 8.x-1.x authored by jcisio
    Issue #2979319 by hass, jcisio: Update to match core behavior on caching
    
hass’s picture

Status: Needs work » Fixed

Thanks for your help. Seems to work based on tests.

jcisio’s picture

Yes I didn't have time to test that test-only patch. Thank you for figuring out the backslash bug, and for the commit!

Status: Fixed » Closed (fixed)

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