function file_entity_update_7227 in File Entity (fieldable files) 7.3
Same name and namespace in other branches
- 7.2 file_entity.install \file_entity_update_7227()
Remove deprecated views_plugin_access_menu plugin.
File
- ./
file_entity.install, line 1102 - Install, update and uninstall functions for the file_entity module.
Code
function file_entity_update_7227() {
$result = db_query("SELECT vid, id, display_options FROM {views_display}");
foreach ($result as $record) {
$options = unserialize($record->display_options);
if (isset($options['access']) && is_array($options['access']) && isset($options['access']['type']) && $options['access']['type'] === 'menu') {
$options['access'] = array(
'type' => 'perm',
'perm' => 'access administration pages',
);
db_query("UPDATE {views_display} SET display_options = :options WHERE vid = :vid AND id = :id", array(
'vid' => $record->vid,
'id' => $record->id,
'options' => serialize($options),
));
}
}
}