function file_entity_update_7101 in File Entity (fieldable files) 7.3
Same name and namespace in other branches
- 7 file_entity.install \file_entity_update_7101()
- 7.2 file_entity.install \file_entity_update_7101()
Update all files with empty types to use the first part of filemime.
For example, an png image with filemime 'image/png' will be assigned a file type of 'image'.
File
- ./
file_entity.install, line 352 - Install, update and uninstall functions for the file_entity module.
Code
function file_entity_update_7101() {
db_update('file_managed')
->expression('type', "SUBSTRING_INDEX(filemime, '/', 1)")
->condition('type', '')
->execute();
}