Drupal 6

http://drupal.org/sandbox/iwhitcomb/1355428
git clone --branch 6.x-1.x iwhitcomb@git.drupal.org:sandbox/iwhitcomb/1355428.git datatable

Data Table is an addition to the core form API which allows the creation of a datatable field type. A data table is a draggable, sortable, table of data. Not only does it provide a table full of editable data, but also allows the developer to define a custom structure to display the data which taps directly into the form API. For example, rather than showing a grid full of text boxes, the developer can specify any of the normal form API elements to be used instead(ie: checkboxes, select lists, text areas, etc..)

This can be tested by creating a form via Drupals form API(See the datatable_example for code example)

CommentFileSizeAuthor
#12 codef2.txt1.93 KBRobertas

Comments

patrickd’s picture

You can name your branches however you want, but if you want that drupal.org can recognize them as releases you have to be shure that they are well formatted (eg. 6.x-1.x). For additional resources please see the documentation about release naming conventions.

README.txt is missing, see the guidelines for in-project documentation

drupalnetworks’s picture

Status: Needs review » Needs work

Review of the 6.x-1.x branch:

Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):

FILE: ...-pareview/sites/all/modules/pareview_temp/test_candidate/datatable.info
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
4 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: ...areview/sites/all/modules/pareview_temp/test_candidate/datatable.module
--------------------------------------------------------------------------------
FOUND 11 ERROR(S) AND 1 WARNING(S) AFFECTING 10 LINE(S)
--------------------------------------------------------------------------------
4 | ERROR | The second line in the file doc comment must be " * @file"
6 | ERROR | Missing function doc comment
23 | WARNING | A comma should follow the last multiline array item. Found: )
39 | ERROR | Missing function doc comment
98 | ERROR | An operator statement must be followed by a single space
98 | ERROR | There must be a single space before an operator statement
119 | ERROR | Missing function doc comment
165 | ERROR | Missing function doc comment
182 | ERROR | Missing function doc comment
185 | ERROR | No space before comment text; expected "// $form =
| | $form_state['form_id']($form_state);" but found "//$form =
| | $form_state['form_id']($form_state);"
209 | ERROR | Concat operator must be surrounded by spaces
209 | ERROR | Concat operator must be surrounded by spaces
--------------------------------------------------------------------------------

FILE: ...pareview_temp/test_candidate/datatable_example/datatable_example.module
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AND 1 WARNING(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
3 | ERROR | Missing function doc comment
15 | ERROR | Missing function doc comment
38 | WARNING | A comma should follow the last multiline array item. Found:
| | 'Cappa'
--------------------------------------------------------------------------------

Remove "version" from the info file, it will be added by drupal.org packaging automatically.
./datatable.module: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming

function process_datatable($element) {

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Source: http://ventral.org/pareview - PAReview.sh online service

iwhitcomb’s picture

Status: Needs work » Needs review

git clone --branch 6.x-1.x iwhitcomb@git.drupal.org:sandbox/iwhitcomb/1355428.git datatable

That should do it. Changed the branch name to 6.x-1.x from 6.x-1.x-dev, also went ahead and added a README.txt to the datatable_example module.

iwhitcomb’s picture

bump

jthorson’s picture

Status: Needs review » Closed (duplicate)

It appears that there have been multiple project applications opened under your username:

Domain Login: http://drupal.org/node/1351074
Data Table Field: http://drupal.org/node/1370250

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue.

With this in mind, I have marked your secondary applications as 'closed(duplicate)', and left one application open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one I that I have left open, then please feel free to close the 'open' application as a duplicate, and re-open one of the other project applications which I had closed.

Thanks in advance for your patience and understanding!

iwhitcomb’s picture

Status: Closed (duplicate) » Needs review

Reopening for review

morgothz’s picture

Status: Needs review » Needs work

Hi!
You have some errors in your sandbox project:

  • There's no file doc comment on your datatable.module
  • There's no function comment for datatable_process_element() function (datatable.module - line 39)
  • There's no function comment for theme_datatable() function (datatable.module - line 119)
  • There's no function comment for datatable_get_field() function (datatable.module - line 165)
  • There's no function comment for datatable_ahah_callback() function (datatable.module - line 182)

Let's see this piece of code:

$rows = array();
  foreach (element_children($element[$element['#name']]) as $child) {
    $cols = $element['#structure'];
    foreach (element_children($element[$element['#name']][$child]) as $field) {
      if (!empty($element[$element['#name']][$child][$field]['#children'])) {
        $cols[$field] = theme('form_element', $element[$element['#name']][$child][$field], $element[$element['#name']][$child][$field]['#children']);
      }
    }
    $rows[] = array(
      'data' => $cols,
      'class' => 'draggable',
    );
  }

I don't understand why you don't use $child variable directly instad of <?ph element_children($element[$element['#name']][$child] ?> in the second foreach; You should use foreach ($child as $field) { instead of foreach (element_children($element[$element['#name']][$child]) as $field) {

The same thing with $field variable declared in the second foreach, you should use:
if (!empty($field['#children'])) { instead of if (!empty($element[$element['#name']][$child][$field]['#children'])) {

Using this way, folowing statement:
$cols[$field] = theme('form_element', $element[$element['#name']][$child][$field], $element[$element['#name']][$child][$field]['#children']); will look like $cols[$field] = theme('form_element', $field, $field['#children']);

I think is more clear using this way.

You must see Doxygen and comment formatting conventions (http://drupal.org/node/1354)

iwhitcomb’s picture

Status: Needs work » Needs review

morgothz -- Thanks for your feeback.

I commented all of the code per the Doxygen documentation.

As for the foreach and the use of element_children.
http://api.drupal.org/api/drupal/includes!common.inc/function/element_ch...

element_children doesn't actually return the array of the child elements, just an array of IDs which explains all of the confusing code. I'm looping over that to get the child element arrays from the main $element which is what you're seeing -- very confusing I know. Unless there's something else out there to return the actual child element(s) then I'm not sure how else to accomplish this.

iwhitcomb’s picture

bump

iwhitcomb’s picture

bump

markhalliwell’s picture

Also bumping this, I would like to get him commit access ASAP as he's part of our team.

Robertas’s picture

StatusFileSize
new1.93 KB

There are still formatting issues - please see attached file.

sbrattla’s picture

Any change this module will be available for Drupal 7 too? It seems very promising.

iwhitcomb’s picture

Robertas -- I took care of the formatting issues

sbrattla -- Yes, absolutely I've already begun porting to D7. Once I get this approved I can start focusing more on that.

iwhitcomb’s picture

bump

iwhitcomb’s picture

Status: Needs review » Closed (won't fix)

closing, not enough support

patrickd’s picture

I'm sorry about the delay, we currently got about 150 applications in the queue and have a huge lack of reviewers, so really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.

Feel free to reopen if you feel like continuing on this.
I was in here my self for several moths waiting, I know how depressing this can be.

Sorry :(

iwhitcomb’s picture

No problem, I understand. I just figured I'd try with something for D7 instead.

iwhitcomb’s picture

Issue summary: View changes

Fixed git clone command