Skip to main content
1 of 3
August1914
  • 303
  • 1
  • 5
  • 16

What is the Programmatic Equivelent of Block Save?

From hook_save, I've updated the "pages" attribute of a block, adding a path to the list.

db_update('block')
    ->fields(array('pages' => $pages))
    ->condition('delta', $delta)
    ->execute();

I've used the database API, (maybe that's the problem?) instead of the block API, because I'm under the impression there is no support in the D7 block api for this. (hook_block_configure I think is just for changes to default block configuration).

The problem I'm having is that the update to the block pages attribute is not reflected, even after clearing caches, until I go to block admin and click [Save] on that block.

Is there a way to do this with the block API, or, what do we do that is equivalent of clicking the [Save] button in block admin?

August1914
  • 303
  • 1
  • 5
  • 16