Hi,
I did review this module with the coder module and coder tough love and did patch some minor things.
Hope that helps this awesome module a bit :)
Added description to administrative menu items.
Some tabs and spaces at lines end.
Added @file to the views and install file.
t() should not be used for menu's title and description.
- 'title' => t('NAT'),
- 'description' => t('Establish node - node relationships via the taxonomy module.'),
+ 'title' => 'NAT',
+ 'description' => 'Establish node - node relationships via the taxonomy module.',
Installation should use st() instead of t().
- drupal_set_message(t('NAT module: Installation script complete.'));
+ drupal_set_message(st('NAT module: Installation script complete.'));
Installation should use update_sql instead of db_query
- $result = db_query('SELECT n.nid, n.tid, td.vid FROM {nat} n INNER JOIN {term_data} td USING (tid)');
+ $result = update_sql("SELECT n.nid, n.tid, td.vid FROM {nat} n INNER JOIN {term_data} td USING (tid)");
I still let this query use db_query because I believe you intetionally wanted to hide a load of queries but still changed teh query to use double quotes.
<?
- db_query('UPDATE {nat} SET vid = %d WHERE nid = %d AND tid = %d', $node['vid'], $node['nid'], $node['tid']);
+ db_query("UPDATE {nat} SET vid = %d WHERE nid = %d AND tid = %d", $node['vid'], $node['nid'], $node['tid']);
?>
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | nat-703712-coder-review.patch | 2.7 KB | anantagati |
| #7 | nat-703712-coder-review.patch | 2.7 KB | anantagati |
| #6 | NAT_coder_review_v03.patch | 2.04 KB | kars-t |
| #2 | NAT_coder_review_v02.patch | 2.07 KB | kars-t |
| #1 | NAT_coder_review_v01.patch | 3.72 KB | kars-t |
Comments
Comment #1
kars-t commentedMissed the patch as it seems. And I figured that I worked against the latest release and not the def version. Uploading the old patch now but making a new one probably sunday against the HEAD version -_-
Comment #2
kars-t commentedNew patch against latest 6--1 branch. Less work because most of the things were already fixed.
Comment #3
anantagati commentedHi Kars-T, I tried to applied patch but it write error:
Comment #4
kars-t commentedHi,
great you are back again! I feared NAT was left unmaintained :)
"\ No newline at end of file" shouldn't be a problem.
How did you apply the patch?
IDE or Shell?
Comment #5
anantagati commentedThanks. As I am only co-maintainer for Views part of the module I wrote today to maintainer if he will not mind that I will take maintaining of this nice module.
I applied it over shell.
Comment #6
kars-t commentedOkay used patch -p0 < and got the error as well.
Than I just removed the line and it works. Resubmitting hacked patch.
Comment #7
anantagati commentedPatch looks good. Changed one db_query() to update_sql() and removed some trailing spaces to pass coder with minor warning level set.
Comment #8
kars-t commentedThere were trailing spaces? Gnah! -_-
I thing this is intenionally db_query because this might give us a lot of update_sql notifcations?
Otherwise its RTBC.
Powered by Dreditor.
Comment #9
anantagati commentedYou are right. It is better to put db_query().
Comment #10
anantagati commentedThank you. Committed.