Download & Extend

_media_recursive_check_plain is not always available

Project:Media
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Devin Carlson
Status:closed (fixed)

Issue Summary

The helper function _media_recursive_check_plain() is defined and used in media.browser.inc but is also used in media.media.inc. Unfortunately, it seems that media.browser.inc is not always loaded which can lead to errors, namely (when searching for files in the media browser):

Warning: array_walk_recursive() expects parameter 2 to be a valid callback, function '_media_recursive_check_plain' not found or invalid function name in media_query_media_browser_alter() (line 55 of /Users/devin/Sites/acquia-drupal/sites/all/modules/media/media.media.inc).

The _media_recursive_check_plain() function should be moved out of media.browser.inc and into media.module where it will always be available.

Comments

#1

Status:active» needs review

A patch to move the function into media.module. I've also removed the leading underscore from the function name, as it doesn't really seem like a helper function since it is used in multiple locations.

AttachmentSizeStatusTest resultOperations
move-and-rename-function-1790448-1.patch2.12 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch move-and-rename-function-1790448-1.patch. Unable to apply patch. See the log in the details link for more information.View details

#2

Status:needs review» reviewed & tested by the community

Looks good to me.

#3

Thanks, seems patch works, no more entries in dblog

#4

Status:reviewed & tested by the community» fixed

commited

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here