There needs to be a refactor to replace nids with entity ids and entity types. This should probably be a column in the media_mover_files table.

CommentFileSizeAuthor
#1 media_mover_entity_api-1926464-5.patch16.46 KBiva2k

Comments

iva2k’s picture

Status: Active » Needs review
StatusFileSize
new16.46 KB

I submitted a patch for this in #5 of #1926464: mm_fields for Drupal 7. Resubmitting it here.

It won't apply without patches that I submitted earlier for those issues:

Sorry, I chopped all the changes into patches sequentially, first focusing on fixing errors. Please commit the other 3 to expedite this patch.

Status: Needs review » Needs work

The last submitted patch, media_mover_entity_api-1926464-5.patch, failed testing.

iva2k’s picture

>The last submitted patch, media_mover_entity_api-1926464-5.patch, failed testing.
It should be failing as it won't apply until the above dependency issues are committed.

arthurf’s picture

I'm not quite sure about the entity_get() and entity_set() methods- I'm thinking that there just needs to be a get_entity() as entity_set() should only be done once when the source file is selected and get_entity() follows the pattern already in place.

I'm also thinking that get_entity_link() should be refactored to use get_entity() to remove some code duplication.

The load_info() should be part of the load() process and should be called on update_uri() so that this information is always relevant to to the current file.

arthurf’s picture

Status: Needs work » Closed (fixed)

This patch actually applies with a small exception to some of the new methods that other patches are adding for file handling. I've committed this as I think this is the most important part. I'll review some of the new file methods on the other posts.