You are here

protected function Block::saveBlockCache in Views (for Drupal 7) 8.3

Save the block cache setting in the blocks table if this block allready exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.

1 call to Block::saveBlockCache()
Block::submitOptionsForm in lib/Views/block/Plugin/views/display/Block.php
Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

File

lib/Views/block/Plugin/views/display/Block.php, line 254
Definition of Drupal\views\Plugin\views\display\Block. Definition of Views\block\Plugin\views\display\Block.

Class

Block
The plugin that handles a block.

Namespace

Views\block\Plugin\views\display

Code

protected function saveBlockCache($delta, $cache_setting) {
  if (strlen($delta) >= 32) {
    $delta = md5($delta);
  }
  if (db_table_exists('block') && ($bid = db_query("SELECT bid FROM {block} WHERE module = 'views' AND delta = :delta", array(
    ':delta' => $delta,
  ))
    ->fetchField())) {
    db_update('block')
      ->fields(array(
      'cache' => $cache_setting,
    ))
      ->condition('module', 'views')
      ->condition('delta', $delta)
      ->execute();
  }
}