CVS edit link for chrislynch42

I've gotten quite a bit over the last several years from Drupal and want to give a little back. Contributing to an open source project is one of my life goals.

I created a module to track my personal book collection. It has a fairly nice Web 2.0 interface which helps to reduce the number of clicks needed for data entry. Additionally I have integrated Google Books with it so that you can just enter the ISBN and it will automatically populate the local database with the books data from Google. You may very well ask why wouldn't I just use Google Books? Control, privacy and I started the module before Google Books existed.

The main difference between the Milan module (the one under review) and the ones that currently exist is that mine is focused on tracking a personal collection. It stores information locally so as to provide more privacy from government and commercial tracking. This isn't additional security but rather privacy through anonymity and poor accessibility. Your information would be readily available stored on sites such as Google books. This module allows for local storage information such as its under my bed or in the attic. It allows for tracking of the books using little information. It provides a structured method for classifying books by genre, series, worlds, authors and publishers. It utilizes Google books to locally save book data via ISBN. Below is a table with my description on the focus of the other similar modules. Each description focuses on the difference from the Milan module.

Module Description
Book Post Doesn't store book data locally and isn't to track books. Is targeted more towards including book data
in other blog like posts so they can be talked about.
MARC & Millennium OPAC Integration These are targeted towards bulk importing library. They aren't targeted to an average user
to just track their book collection with a minimum of effort.
Open Library API These are modules that could provide additional functionality but do not provide the same functionality.

Comments

chrislynch42’s picture

StatusFileSize
new15.44 KB

You can reference my previous attempt to see any previous issues. I have addressed those issues in this code submission. On major change is that I have now seperated it from one module with two sub-modules too three modules. I did this by abstracting the authors and publishers to persons and companies. I have identified them as authors and publishers using taxonomy. This will be useful in the future when other entities can be derived from them.

verbosity’s picture

Status: Postponed (maintainer needs more info) » Needs review

I can't properly review not having cvs access myself, but a couple of points:

1. you need to use the doxygen formatting conventions
http://drupal.org/node/1354
EG.
for each 'hook' function you build should have this at the least

<?
/**
 * Implements hook_help().
 */

?>

2. for all your .tpl.php files ( except : page-milan-person-add.tpl.php ) - and I'm sure this applies to some of your other files.

// $Id: node.tpl.php , v 1.4 2007/08/07 08:39:36 goba Exp $

should be

// $Id$

3. I'm not sure why, but all your tpl.php files are the same ( except node-milan.tpl.php ), and all they do is print $content is there a reason for this?

verbosity’s picture

Status: Needs review » Needs work
chrislynch42’s picture

When you install a module into Drupal it automatically takes // $Id$ and makes it // $Id: node.tpl.php , v 1.4 2007/08/07 08:39:36 goba Exp $ . I suppose I can write a ruby script to automatically take it out.

avpaderno’s picture

Issue tags: +Module review

Hello, and thank you for applying for a CVS account.

When you install a module into Drupal it automatically takes // $Id$ and makes it // $Id: node.tpl.php , v 1.4 2007/08/07 08:39:36 goba Exp $ .

CVS ID tags are expanded when a file is committed in a CVS repository, not when a Drupal module is installed.

chrislynch42’s picture

That makes sense. I am working with the code right now using my own cvs repository. I went ahead and wrote a Ruby script to clean up the Id comments and other issues.

chrislynch42’s picture

I have been working on adding Doxygen comments to the code. I have found a logic error in the code. I could post some updated code or wait until your current review is done. How would you prefer to proceed?

avpaderno’s picture

It would be better if you upload the updated code, to avoid reviewers report something that you have already changed.

chrislynch42’s picture

StatusFileSize
new17.04 KB

Code with Doxygen comments

verbosity’s picture

Hi,
The code looks improved. have you ran it through the coder module? ( also you can use the options to do a 'minor' search for issues)

a couple of points that coder has thrown up ( not an exhaustive list )
company.module Line 80 & Line 127:
company.pages.inc Line 37 & Line 50:
else statements should begin on a new line

  } else {

Should be:

  }
 else {

company.pages.inc
Line 44: Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE

  $output .= node_view($loaded_node , true , false , true);

company.install
milan_series.pages.inc

 ?>
 

the final ?> should be omitted from all code files

you've also got lots of trailing spaces, some tabs instead of double spaces ( using the 'minor option in coder will help with this.

when you mention a function in the doxygen comments you've missed the () from the functions, these should be included
EG: company.install
Line 9: @see should always be followed by a filename, a url or a function name with ()
@see hook_install
should be
@see hook_install()

milan_person.pages.inc
( also appears in milan_company.pages.inc
Line 24: Line 38: Line 40: In SQL strings, Use db_query() placeholders in place of variables. This is a potential source of SQL injection attacks when the variable can come from user data. (Drupal Docs)

  $result = db_query("SELECT n.nid FROM {node} n WHERE n.type = 'person' $author_sql ORDER BY n.title , n.sticky DESC , n.created DESC");

( the above was pulled from coder, it may not be valid, can you explain what the variable is/does in that context and provide a reason to not use a placeholder?

page-milan-company-add.tpl.php
Line -1: @file block missing (Drupal Docs)

There are a few issues with the @file bit, but if I'm honest they didn't make sense to me and I didn't have time to reread the doxygen stuff to make sense of it, its probably needing a space here or a line there type of thing.

I've not had a chance to play around with the module itself to check for bugs, and I'm unlikely to do so before next week. however I'd suggest that you work on the issues here ( using the coder module hint hint ) to allow someone to evaluate its functionality without formatting and doxygen issues.

OH as a final note, please include a readme.txt , I like reading them to find out how to install/use the module

chrislynch42’s picture

StatusFileSize
new18.31 KB

Used the settings you recommended in coder and corrected all the error reports except the following:

1) @file description should be on the following line. I tried several different ways of writing it and it still reported the error.
2) In SQL strings, Use db_query() placeholders in place of variables. This is a potential source of SQL injection attacks when the variable can come from user data. User input is not being placed in a in this case. I used a variable to place a repeated string in multiple queries making the code more readable and maintainable.
3) node-milan.tpl.php The control statement should be on a separate line from the control conditional. It would change the way it would display to put it on multiple lines and in this case it is more readable on one line.

chrislynch42’s picture

StatusFileSize
new18.31 KB

Managed to eliminate the @file errors reported by the coder module. The Drupal comments do not appear to be an exact match for Doxygen.

verbosity’s picture

Status: Needs work » Needs review

I'm afraid I wont be able to look at this for a few days, setting to needs review in the hope someone else will.

@chrislynch42 : each time you submit a revision to your module you should change the status to 'needs review' ( unless it still needs work :P )

chrislynch42’s picture

Should be good for review now.

chrislynch42’s picture

Component: Miscellaneous » miscellaneous
StatusFileSize
new17.34 KB

I did some testing and eliminated a couple of problem areas as well as removing some debug code I found.

chrislynch42’s picture

Status: Needs review » Needs work
StatusFileSize
new17.6 KB

More testing and more bugs resolved. I have found a problem with refreshing the select boxes so I am going to put it in a needs work status until I can get that fixed.

chrislynch42’s picture

Status: Needs work » Needs review
StatusFileSize
new17.91 KB

I changed the code to use the ahah drupal functionality to reload the select boxes. I must say that it works much better than the previous method I was using.

chrislynch42’s picture

StatusFileSize
new130 KB

There was a bug in my handling of the ahah. It does make me question the design decisions of the Form API. Seems awfully complicated just to add some AJAX. I suppose it might be due to security considerations but even so.

chrislynch42’s picture

StatusFileSize
new140 KB

It was saving the nodes anonymously and that has been fixed. Additionally some ISBN numbers would pull multiple entries from google books so changed the code so that it will only insert the first entry.

arianek’s picture

Status: Needs review » Postponed

Hi. Please read all the following and the links provided as this is very important information about your CVS Application:

Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications

  • The status of this application will be put to "postponed" and by following the instructions in the above link, you will be able to reopen it.
  • Or if your application has been "needs work" for more than 5 weeks, your application will be marked as "closed (won't fix)". You can still reopen it, by reading the instructions above.
chrislynch42’s picture

Status: Postponed » Closed (won't fix)
avpaderno’s picture

Component: miscellaneous » new project application
Issue summary: View changes