Closed (fixed)
Project:
D7 Media
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2011 at 01:01 UTC
Updated:
24 May 2011 at 00:51 UTC
Jump to comment: Most recent file
Comments
Comment #2
neochief commentedComment #4
neochief commentedweird...
Comment #5
effulgentsia commentedBut we don't want that code running when any module is enabled. We only want it running when the media module is enabled. The problem is that we need some of the logic within field_modules_enabled() to run first, so the newly enabled file field is properly initialized. We could do this by changing to media_modules_enabled() as #4 suggests, but add a check to make sure 'media' is in the list of modules being enabled. But I'm not crazy about that, because it violates the pattern of modules taking care of their own enabling logic within hook_enable(). Basically, a lower weight module should be able to have its own hook_modules_enabled() that runs after the media module is properly enabled.
So what if instead, we keep it as media_enable(), but add this code at the top of it:
I'm not even sure if we need the first line, maybe just the second?
Comment #6
neochief commentedHow the hook could work if module is disabled? :)
Comment #7
Leeteq commentedComment #8
effulgentsia commentedFixed as part of #1086958: Switch from Media Entity to File Entity. See top of project page, however, for warnings about updating to the dev snapshot.