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.
When I'm using Media Browser Plus with Media-7.x.-2.x versions, title column is empty on your-site.com/admin/content/file/list page. It occures because of usage old template function from Media-7.x-1.x versions:
$options[$media->fid] = array(
'title' => theme('media_link', array('file' => $media)), //<-- This function was removed
'folder' => $folder,
'type' => check_plain($media->filemime),
'size' => format_size($media->filesize),
'author' => theme('username', array('account' => $media_user)),
'timestamp' => format_date($media->timestamp, 'short'),
);
I propose this solution:
//Support 7.x-1.x versions of Media module
if (function_exists('theme_media_link')) {
$title_callback = 'media_link';
}
else {
$title_callback = 'file_entity_file_link';
}
$options[$media->fid] = array(
'title' => theme($title_callback, array('file' => $media)),
'folder' => $folder,
'type' => check_plain($media->filemime),
'size' => format_size($media->filesize),
'author' => theme('username', array('account' => $media_user)),
'timestamp' => format_date($media->timestamp, 'short'),
);
Or even reuqire Media 2 for Medai browser plus 2.
Comments
Comment #1
m1r1k CreditAttribution: m1r1k commentedComment #2
corbin CreditAttribution: corbin commentedMoreover, the "media_browser_plus-7.x-2.x-empty-title-column-1054616.patch"
makes the following(s) message(s) :
Uninitialized string offset: 0 in form_process_tableselect() (line 3371 of /.../www/includes/form.inc)
disappear.
Comment #3
korven CreditAttribution: korven commented@m1r1k
Your solution worked for me.
I am on Media 7.x-2.0-unstable7+20-dev though. But I did update from Media 1.x, perhaps there are some db inconsistency during the update from Media 1.x -> 2.x
Comment #4
nagy.balint CreditAttribution: nagy.balint commentedOn the latest version the list view is empty for me even after this patch.
It turned out that the issue was that the data was mobed under the ['admin'] key in the $form variable. So i altered the above patch to work with that.
Maybe not the best way to solve the problem, but it works for me now.
Comment #5
nagy.balint CreditAttribution: nagy.balint commentedJust noticed that then the "vbo" actions were not working, so here is an updated patch.
Comment #6
salvis