Comments

dave reid’s picture

Component: Code » File entity
dave reid’s picture

Assigned: Unassigned » dave reid
Issue tags: +Media Sprint 2011
JacobSingh’s picture

Since the file_entity module is sorta like the new file module, we should move over all the UIs for managing files. It seems like a good idea since node CRUD screens are stored in node, taxonomy CRUD in taxonomy, etc.

So w'll do two things:

  • Move media/%file, media/%file/edit, etc to file_entity.
  • Move over permissions.
  • Write an update function to fix the permissions callback.
robeano’s picture

The following patch moves basic file operations out of the Media Module and into File Entity module. Viewing, editing, deleting files is now handled by File Entity.

robeano’s picture

I missed hook_permission(). Rolling new patches.

JacobSingh’s picture

Status: Active » Needs work

A few small typos, etc.

+++ b/file_entity.installundefined
@@ -219,3 +219,17 @@ function file_entity_update_7101() {
\ No newline at end of file

fix..

+++ b/file_entity.pages.incundefined
@@ -0,0 +1,192 @@
+ */

add a newline here?

+++ b/file_entity.pages.incundefined
@@ -0,0 +1,192 @@
+  if (!user_access('administer files') && (file_uri_scheme($file->uri) === 'private')) {
+    return MENU_ACCESS_DENIED;

This can be a followup, but shouldn't this be part of the access callback.

+++ b/file_entity.pages.incundefined
@@ -0,0 +1,192 @@
+/*  $form['#attached'] = array(
+    'css' => array(drupal_get_path('module', 'media') . '/css/media.css'),
+  );
+
+  // Not sure about this class name, seems to indicate the style.
+  $form['#attributes']['class'][] = 'media-image-left';
+  $form['#attributes']['class'][] = 'media-edit-form';

Why add this commented stuff?

+++ b/file_entity.pages.incundefined
@@ -0,0 +1,192 @@
+
+

less spaces?

robeano’s picture

Status: Needs work » Active
StatusFileSize
new10.24 KB

oops. My last file-ops-file-entity1224788.patch file was missing the new file file_entity.pages.inc. It is included with this patch.

robeano’s picture

Assigned: dave reid » robeano

We found that Media sets some defautls like gruning on View modes for each file type which File Entity does not do...yet. That's for another issue to solve and won't be a part of the current patches.

robeano’s picture

New version of each patch. Minor clean up plus added hook_admin_paths to file_entity.

JacobSingh’s picture

Status: Active » Reviewed & tested by the community

This is good to go. One little bug which Robin knows about and is fixing. Otherwise tested.

robeano’s picture

Status: Reviewed & tested by the community » Fixed

Committed to both modules:

Media: 5685d5c

File Entity: 555650a

dave reid’s picture

Assigned: robeano » aaron
Priority: Normal » Critical
Status: Fixed » Needs work

We actually have several problems: we missed the update for 'view media' => 'view files' and 'edit media' => 'edit files' as well. Likely we should move this update hook back to media since it's responsible for it's permissions changing.

aaron’s picture

Status: Needs work » Needs review
StatusFileSize
new1.47 KB

this checks that the perm exists before continuing, throwing a recoverable error otherwise.

aaron’s picture

aaron’s picture

StatusFileSize
new1.47 KB

oops; forgot to renumber the update_N properly.

aaron’s picture

StatusFileSize
new1.73 KB

handle the admin perms here too as well, rather than in file entity. (file entity may be installed w/o media).

aaron’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.97 KB

here's the real patch. rtbc by robeano irl

aaron’s picture

Status: Reviewed & tested by the community » Fixed

and committed.

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