You are here

function panelizer_update_7121 in Panelizer 7.3

Fix the 'selection' variables.

File

./panelizer.install, line 1141
Install, update and uninstall functions for the panelizer module.

Code

function panelizer_update_7121() {
  foreach (entity_get_info() as $entity_type => $entity_info) {
    if (isset($entity_info['bundles'])) {
      foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {

        // View mode variables.
        if (!empty($entity_info['view modes'])) {
          foreach ($entity_info['view modes'] as $view_mode => $view_info) {
            $var_name = 'panelizer_' . $entity_type . ':' . $bundle_name . ':' . $view_mode . '_selection';
            $var = variable_get($var_name);
            if (empty($var)) {
              variable_del($var_name);
            }
          }
        }
      }
    }
  }
}