Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Renamed files keep the old name as description when they are already assigned to a file field because this module does not update the filename column in the file_managed table. Can someone please change the imce_rename_file so it updates the filename too? It is as simple as moving a line of code before the call to file_move:
function imce_rename_file(&$imce, $old_uri, $new_uri) {
...
...
$file->filename = drupal_basename($new_uri); // New line
$move = file_move($file, $new_uri, FILE_EXISTS_ERROR);
$file->uri = $new_uri;
//$file->filename = basename($file->uri); // Old line
...
...
}
Comments
Comment #2
jacmkno CreditAttribution: jacmkno commentedComment #3
jacmkno CreditAttribution: jacmkno commented