Views provides Edit and Delete links for core entity types like nodes.

File entity module should provide analogous handlers for file entities because it is providing the file/%file/edit and file/%file/delete paths.

This should be a relatively straightforward patch.

Comments

stevector’s picture

Status: Active » Needs review
StatusFileSize
new5.43 KB

I also added a View link that goes to file/%fid

dave reid’s picture

Status: Needs review » Needs work

Please make the links use Sentence case ('Edit' not 'edit'). Looks like two of the titles in file_entity_views_data() also need to be fixed: t('link') and t('delete').

alex.skrypnyk’s picture

Thanks for the patch - works great!
Could you please make the requested adjustments so it can be merged with HEAD.

Jackinloadup’s picture

StatusFileSize
new2.72 KB
new5.43 KB

Here are the requested changes.

This patch will be affected by #1227706: Add a file entity access API

devin carlson’s picture

Status: Needs work » Needs review
ParisLiakos’s picture

circuscowboy’s picture

StatusFileSize
new5.45 KB

updated patch to play nice with #1227706: Add a file entity access API

Status: Needs review » Needs work

The last submitted patch, views_field_handler_links-1778370-7.patch, failed testing.

circuscowboy’s picture

StatusFileSize
new1.97 KB

Lets try again

circuscowboy’s picture

Status: Needs work » Needs review
Anonymous’s picture

Thanks for the patch. I noticed that latest patch doesn't include the 3 new views includes. I had to pull those from the previous patch.

slashrsm’s picture

Here is re-rolled patch with classes included.

ParisLiakos’s picture

Status: Needs review » Needs work
+++ b/views/views_handler_field_file_link.incundefined
@@ -0,0 +1,48 @@
+    if (file_entity_access('view')) {

Please pass $file as argument

+++ b/views/views_handler_field_file_link_delete.incundefined
@@ -0,0 +1,31 @@
+    if (!file_entity_access('edit')) {

Same and use update instead of edit

+++ b/views/views_handler_field_file_link_edit.incundefined
@@ -0,0 +1,31 @@
+    // Ensure user has access to edit this file.

same and use delete isntead of edit

slashrsm’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB
new0 bytes

Here it is...

slashrsm’s picture

Corrected patch for #14.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

i think its good to go

ParisLiakos’s picture

Status: Reviewed & tested by the community » Fixed

thanks to all of you and sorry for the delay
commited

Status: Fixed » Closed (fixed)

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