Comments

NROTC_Webmaster’s picture

Here is a patch for the module file and the install file

NROTC_Webmaster’s picture

Status: Active » Needs review
wojtha’s picture

StatusFileSize
new20.38 KB
new32.22 KB

Additionally fixed:

  • Several missing brackets in if/else/while/foreach statemets.
  • Several fixes of missing t() or with faulty formatted strings (e.g. in the hook_help)
  • Refactored _php_errors_get_roles_emails(), now it uses db_placeholders() to properly cleanup the user roles in the db_query().
  • Addes several missing comments at the function declarations.
  • In PHP 5.3 deprecated split and join replaced by implode and explode.
  • count() replaced by !empty() where possible (its more safe and less CPU intensive).

Plus fixed the following bug which will cause undesired behavior:

-  if (!count($users)) break;
-  
+  if (empty($users)) {
+    return;
+  }

(Break will do nothing since we are not inside the loop so the code will continue to execute.)

wojtha’s picture

StatusFileSize
new16.38 KB

The INFO file needs cleanup as well.

PS: Just noticed that my patches in the previous comment has wrong encoding and line endings, sorry for that.

wojtha’s picture

StatusFileSize
new11.25 KB
new16.62 KB

Additionally fixed:

  • Constants should be in uppercase.
  • Table names in DB queries should be delimeted curly brackets.

Interdiff is against #1.