Please find attached a patch to fix 80+ coding standard issues in Tabledrag Example module. I have found these issues using pareview.sh script provided by klausi.

Please review and apply this patch.

Comments

mile23’s picture

Status: Needs review » Needs work

Thanks for running the module through your magic compliance machine. :-)

Just a few things..

+++ b/tabledrag_example/tabledrag_example_parent_form.incundefined
@@ -5,7 +5,7 @@
@@ -22,11 +22,11 @@ function tabledrag_example_parent_form($form_state) {

@@ -22,11 +22,11 @@ function tabledrag_example_parent_form($form_state) {
   // are sorted by weight relative to their siblings.
   // To keep this from cluttering the actual tabledrag code, we have moved
   // this to a dedicated function.
-
+  //
   // Fetch the example data from the database, ordered by parent/child/weight.
   $result = tabledrag_example_parent_get_data();

Not all empty lines are wrong. I think that's a natural break in the flow of the comments, though it's debatable of course.

+++ b/tabledrag_example/tabledrag_example_parent_form.incundefined
@@ -125,10 +125,10 @@ function tabledrag_example_parent_form($form_state) {
@@ -136,7 +136,7 @@ function theme_tabledrag_example_parent_form($variables) {

@@ -136,7 +136,7 @@ function theme_tabledrag_example_parent_form($variables) {
     // drupal_add_tabledrag call.
     //
     // This could also have been done during the form declaration by adding
-    //     '#attributes' => array('class' => 'example-item-weight'),
+    // '#attributes' => array('class' => 'example-item-weight'),
     // directly to the 'weight' element in tabledrag_example_simple_form().

This should really be a @code directive. http://drupal.org/coding-standards/docs#code

mile23’s picture

Hmm. Dreditor seems to have the hiccups.

amitgoyal’s picture

Status: Needs work » Needs review
StatusFileSize
new19.28 KB

@Mile23 - Please find attached updated patch based on your suggestions.

mile23’s picture

Coder found another one that I took care of:

tabledrag_example_parent_form.inc
Line 177: Functions should be called with no spaces between the function name and opening parentheses
unset ($form['example_items'][$id]['depth']);

Also: No tests for tabledrag_example. Sob. Since this is a coding standards issue though, I'll fire up another issue.

Looks great, amitgoyal. Thanks. :-)

Committed: http://drupalcode.org/project/examples.git/commitdiff/bf73ec93d5e85cb4b2...

mile23’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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