1 image.install | _image_update_1004(&$data) |
Helper function to update an image field or instance's default image.
Related topics
File
- core/
modules/ image/ image.install, line 302 - Install, update and uninstall functions for the image module.
Code
function _image_update_1004(&$data) {
$old_fid = NULL;
$old_default = $data['settings']['default_image'];
if ($old_default && is_numeric($old_default)) {
$old_default = db_query("SELECT * FROM {file_managed} WHERE fid = :fid", array(':fid' => $old_default))->fetchAssoc();
}
if (is_array($old_default) && isset($old_default['uri'])) {
$data['settings']['default_image'] = $old_default['uri'];
$old_fid = $old_default['fid'];
}
else {
$data['settings']['default_image'] = '';
}
return $old_fid;
}