Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2017 at 06:24 UTC
Updated:
20 Apr 2017 at 17:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
czigor commentedComment #3
czigor commentedComment #4
plachLooks good
Comment #6
joseph.olstadits now in 7.x-2.x dev
Thanks.
Comment #7
joseph.olstadThis appears to have caused a regression:
#2856016: Call to undefined method EntityTranslationUserHandler::getActiveLanguage()
going to have to revert this change.
Comment #9
joseph.olstadPlease see my comments and explanation and suggestions for moving forward in #2856016: Call to undefined method EntityTranslationUserHandler::getActiveLanguage()
Needs work. Please choose a solution that is backwards compatible with those that are not using the Entity translation API , either make it work both ways, or we add a dependency to Entity translation API.
Comment #10
czigor commentedThe patch is correct. The issue is that the new methods are only in Entity Translation dev, and not in a tagged release yet. @plach wants to wait some more days. So yes, probably the best thing to do is wait with committing this until ET has a tagged release.
Comment #11
plachAgreed, we need a new ET release first. Sorry for being too quick to RTBC.
Comment #12
joseph.olstadOK sounds good thanks.
Comment #13
joseph.olstadTo help make this change a successful rollout we should enforce a minimum version of entity translation api in the media.info file.
so I suggest adding this to media.info, piece of cake , so once you've got entity translation api tagged and released we can make this change and document this in the release notes.
Comment #14
plachET Beta 6 is out: https://www.drupal.org/project/entity_translation/releases/7.x-1.0-beta6.
Settings to NW to address #13. We should probably update all the other patches around the same way.
Thanks!
Comment #15
plach@joseph.olstad:
Now that I think about it, ET is only a soft dependency for Media, however by specifying it into the .info file we would make it an actual dependency. I'm not sure we want that.
Comment #16
joseph.olstad@plach , I ran some simple tests of this change (the above patch) against the latest version of entity_translation (beta6) and the latest version of media. Appears to behave correctly so-far.
Would be nice for this change to get some mileage in dev.
Comment #17
joseph.olstadas for improving this patch, I might suggest that we implement a hook_requirements to check to see if entity_translation is used and then check the version there. Perhaps before committing this to dev, it would be good to add a hook_requirements call for hook_install and some sort of checks to a hook_update to make sure that IF entity_translation is used that it is INDEED at least beta6 or newer.
Comment #18
joseph.olstadI like this change and it makes sense. Just haven't had a chance yet to test it or to make the requirements check.
Comment #19
plachYeah, good point, I'll post a new patch ASAP
Comment #20
joseph.olstadHi @plach , you'll probably be interested in this hook_requirements for the other modules that have had this change of entity_translation api calls. here is a suggested hook_requirements code that you could use for this.
NOTE: I haven't yet tested this code, only partially, I know that the system_get_info works and that the version and datestamp info comes in an array returned by system_get_info, that works. I was thinking this hook_requirements should go into the .install file ? add this to the patch? or would this just go into media.module ?
Comment #21
joseph.olstadmedia_requirements from previous comment needs to be added to the patch, and then tested/reviewed.
Comment #22
joseph.olstadHere's the interdiff.
New patch.
Comment #23
joseph.olstadreminder to myself to add a check for
Comment #24
joseph.olstadfixed a couple type-o's.
added isset check, could be improved upon.
Needs testing , I ran a test on my own env, but forgot that I already have entity_translation beta6 , so to test that the hook_requirements work someone needs to use an OLD version of entity_translation prior to beta6 , so beta5 et
(make sure entity_translation beta5 is enabled) , test the patch,
expected result: warns you to upgrade to entity_translation beta6 as required so as to prevent people from running the media module with older versions of entity_translation .
Comment #25
joseph.olstadWondering if hook_requirements 'runtime' should be checked in addition to 'update' and 'install'
$phase == 'runtime'Comment #27
joseph.olstadFixed in 7.x-2.x dev branch