- 🇲🇩Moldova gzveri
Comment in #10 helped.
This worked for me in Drupal9 , I needed the replaced text not being cached.$result = new FilterProcessResult($new_text); $result->setCacheMaxAge(0); // don't cache. return $result;
Hi,
On my client website, I've enabled PHP → module and I've noticed that the results are cached, and the cache => FALSE option on the php\src\Plugin\Filter\Php.php is ignored:
/**
* Provides PHP code filter. Use with care.
*
* @Filter(
* id = "php_code",
* module = "php",
* title = @Translation("PHP evaluator"),
* description = @Translation("Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!"),
* type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
<strong> * cache = FALSE</strong>
* )
*/
How to reproduce:
1. Enable PHP module and Create block
2. Text format: PHP
3. Insert code <?php print time(); ?>
4. Save block and assign it to any region
5. Open the page and check the result
6. Refresh the page or open another page - the result will be the same
The very strange is that fact that on my local fresh environment I don't have such problems and results are NOT cached.
Is this mean that there are some other drupal settings which control the block cache?
Thanks.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Comment in #10 helped.
This worked for me in Drupal9 , I needed the replaced text not being cached.
$result = new FilterProcessResult($new_text);
$result->setCacheMaxAge(0); // don't cache.
return $result;