Closed (fixed)
Project:
Media Mover
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2013 at 02:12 UTC
Updated:
15 Mar 2013 at 23:17 UTC
Jump to comment: Most recent file
Comments
Comment #1
arthurf commentedHow about mm_fields? Seems like it keeps the flexibility open- meaning that it potentially use the file or image fields- or even operate on a text field in some way. I defer to you, but mm_fields feels easy to me.
Comment #2
iva2k commentedI like it. mm_fields it is then.
Comment #3
iva2k commentedAPI question (to unblock mm_fields patch):
Table {media_mover_files} has 'nid' column. I want to change it to two columns - 'entity_type', 'entity_id' (so any entity can be managed). There are indexes needed on those (as there will be WHERE clauses), that's why I don't want to put those into 'data' blob.
I can add all appropriate code: hook_update, new methods in class_media_mover_file, etc. hook_update will populate entity_id = 'node' for all 'nid' set, and convert nid into entity_id, so it will be forward-compatible.
Do you agree with the proposal?
Comment #4
arthurf commentedAbsolutely agreed.
Comment #5
iva2k commentedHere's a patch that converts core media mover to Entity API (will be required by mm_fields module). It removes ad-hoc support for node/nid in different stores and makes a consistent use of {media_mover_files}.entity_type/entity_id. There are also some provisions to better maintain fid in the file object and {media_mover_files} table.
This patch depends on the earlier patches I submitted for these issues:
[UPDATE] this patch was duplicated into issue #1930772: Replace nid with enitity_id and entity_type (which is dedicated to its purpose)
Comment #6
iva2k commentedSetting to "needs review" to try the testbot anyway.
Comment #8
iva2k commented>The last submitted patch, media_mover_entity_api-1926464-5.patch, failed testing.
Not surprising as it needs the other patches listed in #5.
Comment #9
iva2k commentedHere's a patch which introduces a fully working mm_fields submodule.
I beat on testing and making these features work without errors/warnings:
Note that there are core patches needed for this submodule to work properly, however core tests should not fail (this patch does not touch anything in the core):
The features I omitted for now for lack of time (these can be finished later as increments as the code stubs are there):
Comment #10
iva2k commentedSee my full code snapshot (it includes last minute fixes) in comments for #987000: [META] D7 port of media_mover module.
Comment #11
arthurf commentedPatch in comment committed- this is great!