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

douggreen - September 21, 2008 - 14:27
Status:active» needs review

Please test this patch, which should fix the warning (although I haven't tested it).

AttachmentSize
307010.patch 610 bytes

#2

stella - September 28, 2008 - 13:06
Status:needs review» needs work

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

douggreen - September 28, 2008 - 23:21
Status:needs work» needs review

Right, thanks

AttachmentSize
307010.patch 612 bytes

#4

stella - September 29, 2008 - 10:52

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

AttachmentSize
coder_307010.patch 672 bytes

#5

hailu - October 7, 2008 - 19:34
Status:needs review» reviewed & tested by the community

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

 
 

Drupal is a registered trademark of Dries Buytaert.