Is it possible to backport "uri_callback" in hook_entity_info alter. So as is done in file_entity v2.
This way it is possible to support linkit with media V1.
See corresponding Linkit issuu.

In file_entity.module add

function file_entity_entity_info_alter(&$entity_info) {
$entity_info['file']['uri callback'] = 'file_entity_uri';

and add function
/**
* URI callback for file entities.
*/
function file_entity_uri($file) {
  $uri['path'] = 'file/' . $file->fid;
  return $uri;
}

Such as done in file_entity V2 should probably do the trick.
Files: 
CommentFileSizeAuthor
#11 1561012-entity-media-uri-callback-comment-fix.patch433 bytesattila.fekete
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#6 1561012-entity-media-uri-callback.patch1.05 KBnetsensei
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]
#3 1561012-entity-file-uri-callback.patch911 bytesnetsensei
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]
#1 expand_entity_info-1561012-2.patch1.02 KBmallezie
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]

Comments

StatusFileSize
new1.02 KB
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]

Created a patch, and expanded some more info setting. probably not getting in with feature freeze of V1. But i wanted to share. Since it's a solution to make Linkit work with media v1.

Status:Active» Needs work

Entity URI callbacks should actually go to the "internal" pages or media/%file and not be using file_create_url().

Status:Needs work» Needs review
StatusFileSize
new911 bytes
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]

Needed this too to get Media 1.x working with Linkit.

Per the comment in #2: The patch uses "file/" . $file->fid One could argue if "media/" . $file->fid would be more fitting, but since we're working on a "File entity", I'd honor the "entity-name/" . $id convention.

Rerolled the patch per the comment in #2.

Title:define "uri callback"Define the "uri callback" in file_entity_entity_info_alter

Title:Define the "uri callback" in file_entity_entity_info_alterDefine the "uri callback" for file entities (1.x)
Component:File entity» Code
Status:Needs review» Needs work

Problem is in the 1.x branch there is no such path file/%file. It actually lives at media/%file and is exposed by Media module. And so this uri callback should actually be altered in and owned by the media module.

StatusFileSize
new1.05 KB
FAILED: [[SimpleTest]]: [MySQL] 11 pass(es), 0 fail(s), and 12 exception(s).
[ View ]

Taking another stab at this. I've moved the callback to the media module. Linkit keeps working as it should and files are exposed through "media/%file"

Status:Needs work» Needs review

Changing the status.

Status:Needs review» Needs work

The last submitted patch, 1561012-entity-media-uri-callback.patch, failed testing.

Status:Needs work» Fixed

#6 looks good to me
commited

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Needs review
StatusFileSize
new433 bytes
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Two extra '+' signs were left in the comment section, just made a patch to fix that.

Status:Needs review» Reviewed & tested by the community

Yup. Overlooked those. Patch looks good.

Status:Reviewed & tested by the community» Fixed

Thanks for the catch. I've committed it.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.