5.x-6.x test catches false positive for use of hook_info()
hailu - September 11, 2008 - 15:15
| Project: | Coder |
| Version: | 6.x-1.x-dev |
| Component: | Review/Rules |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
This was generated by running the 5.x-6.x upgrade review on imagefield.module
#
Line 183: hook no longer exists, use hook_form_alter() to swap your own validation handler (Drupal Docs)
$db_info = content_database_info($field);
#
severity: criticalLine 231: hook no longer exists, use hook_form_alter() to swap your own validation handler (Drupal Docs)
$db_info = content_database_info($field);
__________________________________________________
content_database_info() is defined in content.module, and is not an attempt to call the deprecated hook_info

#1
Please test this patch, which should fix the warning (although I haven't tested it).
#2
This doesn't fix the issue. Either change the "#not" to "#never" or expand on the #value regex to include more of the pattern before "_info" so it can be included in the value passed to the #not regex.
Cheers,
Stella
#3
Right, thanks
#4
No, that still doesn't work. There's two things wrong. First of all the #value line has changed but there's no +/- lines in the patch for this change. Secondly the \w+ doesn't match the [\s\(] required at the beginning of the #not regex.
Here's another patch which attempts to fix this.
Cheers,
Stella
#5
I tried stella's latest patch, and with it cleanly applied to coder_6x.inc. a review of imagefield module did not return the error regarding invalid use of the deprecated hook_info, when it was really seeing content_database_info() which is defined in content.module