Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The function media_query_media_browser_alter()
in media.media.inc is incorrect. It states:
/**
* Implements hook_query_media_browser_alter().
*/
but it actually implements hook_query_TAG_alter provided by system.module.
query_media_browser_alter
is also listed as a media hook in media_hook_info
. I believe this is incorrect and should be removed.
Comments
Comment #1
Devin Carlson CreditAttribution: Devin Carlson commentedA patch to correct the documentation and remove the hook from
media_hook_info
.Since the function doesn't actually implement a media hook, I think it should be moved out of media.media.inc (probably into media.module), but I'll leave that for a separate issue.
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedthanks.
not committing it yet, since i dont want to break a patch by accident that people in atlanta might review
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedthanks commited
http://drupalcode.org/project/media.git/commit/a0d2c0d
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedi reverted this..removing the hook from hook_hook_info results to media_query_media_browser_alter() never being called..we need to move this function to the .module file
I would say we need tests for this..but i guess we need testbot first
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedA year and a half later with tests!
The tests exposed a few other issues, so including the fixes in this patch.
Comment #7
Devin Carlson CreditAttribution: Devin Carlson commentedA better display of the test failures.
Comment #9
Dave ReidIt's perfectly save to leave in the media_hook_info() part. That just needlessly breaks implementations in custom code if removed.
Comment #10
Devin Carlson CreditAttribution: Devin Carlson commentedFair enough. :)
Committed only the doxygen change from the original patch.