Drupal 7 – The form has become outdated

After enabling the Cache blocks option @ admin/config/development/performance, the form inside a custom block throws the following error.

  • The form has become outdated. Copy any unsaved work in the form below and then reload this page.

 

One work around is to disable cache for that specific custom block and this could be done by adding the DRUPAL_NO_CACHE in your hook_block_info().

/**
 * Implements hook_block_info().
 */
function <module>_block_info() {
  $blocks = array();

  $blocks['eureka'] = array(
    'info' => t('Eureka'),
    'cache' => DRUPAL_NO_CACHE,
  );
 
  return $blocks;
}

 

Done =)

Reference: Drupal API – constant DRUPAL_NO_CACHE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s