I am just trying resolve a random bug so decided to run some modules through the Coder module to eliminate that as a possible issue. Saw few issues with the D7 version that would be great to get into an upcoming release.

CommentFileSizeAuthor
#5 run_through_coder-1078778-5.patch6.28 KBidflood
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

febbraro’s picture

Did a first quick pass. Need to investigate some of the FAPI stuff.

http://drupalcode.org/project/context.git/commit/fcaf202

mgifford’s picture

Cool, thanks! There are a number of changes in FAPI for sure in D7.

febbraro’s picture

The coder messages are a bit weird with respect to FAPI #title and #description. It keeps saying:

[critical] Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use c(), f() or similar to ensure your $variable is fully sanitized.

and

[critical] Potential problem: d() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using c(), f() or similar.

What the heck is c(), d() or f()?

mgifford’s picture

It's definitely a cryptic message. Certainly for critical errors coder should be really clear and point to a url with more info.

Have you asked in the Coder issue queue?

idflood’s picture

Status: Active » Needs work
FileSize
6.28 KB

The coder error message seems to be related to this issue: http://drupal.org/node/912490 . So make sure to use the 7.x-1.x-dev version of coder, these errors are now something like:

Line 45: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.

Here is a first pass. There are still a lot of @file blocks missing (http://drupal.org/node/1354#files) and some other issues. I also added a t() function and changed some.

mgifford’s picture

Sorry, doesn't apply against 7.x-3.x:

$ git apply run_through_coder-1078778-5.patch
error: patch failed: plugins/context_reaction_block.inc:42
error: plugins/context_reaction_block.inc: patch does not apply

kenorb’s picture

Patch doesn't apply.

I've also these onces when checking (drush --contrib --no-empty --upgrade7x coder-review):

sites/all/modules/contrib/context/context.module:
+15: [critical] Info file should specify core=7.x

sites/all/modules/contrib/context/context.core.inc:
+130: [critical] Parameters to hook_form_alter http://api.drupal.org/api/function/hook_form_alter/7() have changed.

sites/all/modules/contrib/context/context.install:
+15: [critical] A module no longer should explicitly install or uninstall its database schema in hook_install http://api.drupal.org/api/function/hook_install/7() or hook_uninstall http://api.drupal.org/api/function/hook_uninstall/7().
+111: [critical] Update hooks now return translated strings or throw exceptions

sites/all/modules/contrib/context/context_layouts/plugins/context_layouts_reaction_block.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/context_ui.install:
+8: [critical] Update hooks now return translated strings or throw exceptions

sites/all/modules/contrib/context/context_ui/context_ui.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/context_ui_dialog.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/jquery.pageEditor.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/json2.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/theme/filter.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/plugins/context_reaction_block.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.
+338: [critical] Changed Drupal.behaviors to objects having the methods "attach" and "detach".

sites/all/modules/contrib/context/plugins/context_reaction_css_injector.inc:
+27: [critical] Parameters to drupal_add_css http://api.drupal.org/api/function/drupal_add_css/7() have changed.

sites/all/modules/contrib/context/tests/context.conditions.test:
+42: [critical] user_delete http://api.drupal.org/api/function/user_delete/6() replaced by user_cancel http://api.drupal.org/api/function/user_cancel/7()
+43: [critical] user_delete http://api.drupal.org/api/function/user_delete/6() replaced by user_cancel http://api.drupal.org/api/function/user_cancel/7()
+89: [critical] user_delete http://api.drupal.org/api/function/user_delete/6() replaced by user_cancel http://api.drupal.org/api/function/user_cancel/7()
+90: [critical] user_delete http://api.drupal.org/api/function/user_delete/6() replaced by user_cancel http://api.drupal.org/api/function/user_cancel/7()

sites/all/modules/contrib/context/context_layouts/plugins/context_layouts_reaction_block.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/context_ui.module:
+15: [critical] Info file should specify core=7.x

sites/all/modules/contrib/context/context_ui/context_ui.install:
+8: [critical] Update hooks now return translated strings or throw exceptions

sites/all/modules/contrib/context/context_ui/context_ui.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/context_ui_dialog.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/jquery.pageEditor.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/json2.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

sites/all/modules/contrib/context/context_ui/theme/filter.js:
File: [critical] JavaScript should be compatible with other libraries than jQuery.

kenorb’s picture

Priority: Normal » Minor
Issue summary: View changes