As far as i can tell, the syntax for the results for the media browser has changed.

For us, the following code is never reached:

// The Search API module returns the row in a slightly different format,
// so convert it to the format that the normal file_managed table returns.
if (!empty($row->entity->fid)) {
  $vars['rows'][$index]->fid = $row->entity->fid;
}

In the data-structure i am seeing on our site, the entity-property is not an object, it is an integer. There is however, a property called _entity_properties that contains the fid.

I propose extending the condition to look for that:

// The Search API module returns the row in a slightly different format,
// so convert it to the format that the normal file_managed table returns.
if (!empty($row->_entity_properties['fid'])) {
  $vars['rows'][$index]->fid = $row->_entity_properties['fid'];
}
// Support older versions of Search API, returning results in this format.
elseif (!empty($row->entity->fid)) {
  $vars['rows'][$index]->fid = $row->entity->fid;
}
CommentFileSizeAuthor
#2 upgrading_to_search_api-2680103-2.patch797 bytesmian3010

Comments

mian3010 created an issue. See original summary.

mian3010’s picture

StatusFileSize
new797 bytes

Attached proposed solution

chris matthews’s picture

Status: Active » Closed (outdated)

Recent versions of media have resolved most of peoples concerns and is compatible with entity translation, multilingual and various advanced configurations. Due to the high volume of inactive and most often irrelevant issues we are Closing this as (outdated). If for whatever reason this issue is important to you AND you still have issues after checking the media recipe documentation, then let us know and we will review your concerns.

Otherwise, see the recipe documentation for how to configure media and for troubleshooting tips OR refer to the media_dev distribution if you want to see a working media setup.

As mentioned, feel free to make some noise in this issue if you still feel it is important to you or someone else.

Thanks,

Media team