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.
In check_markup caching is set to FALSE. Is this for a special reason? It breaks caching for text formats that are used with this boxes content. I have a custom filter that calls out to an external service and the callback is triggered all the time causing lot's of traffic instead of reading the stuff from cache.
I tested with this parameter set to TRUE and could not find any side effects. Can I consider this as a bug?
http://drupalcode.org/project/boxes.git/blob/refs/heads/7.x-1.x:/plugins...
/**
* Implementation of boxes_box::render().
*/
public function render() {
$content = '';
if (!empty($this->options['body']['value']) && isset($this->options['body']['format'])) {
$content = check_markup($this->options['body']['value'], $this->options['body']['format'], $langcode = '' /* TODO Set this variable. */, FALSE);
}
$title = isset($this->title) ? $this->title : NULL;
return array(
'delta' => $this->delta, // Crucial.
'title' => $title,
'subject' => check_plain($title),
'content' => $content,
);
}
check_markup()
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/modules/fi...
Comment | File | Size | Author |
---|---|---|---|
#3 | 1985452.boxes_.simple-boxes-filtered-text-not-cached.patch | 745 bytes | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThis does seem a little odd.
Caching of text filter output is a pretty important part of speeding up performance. Having to re-filter text in boxes doesn't seem like a good idea -- let's make this a bug report.
Comment #2
joachim CreditAttribution: joachim commentedThe docs for https://api.drupal.org/api/drupal/modules!filter!filter.module/function/... say:
So one could argue that because blocks are cached, there's no need to cache the filtering of the block content.
However, blocks are not always cached. If hook_node_grants() is implemented by anyone, block caching is disabled.
Also, block module itself lets check_markup() cache. So unless there's a very good reason -- and I don't see one -- we should do that too.
Comment #3
joachim CreditAttribution: joachim commented