CVS edit link for wjaspers

Ubercart's default Dimensions attributes are a huge pain for complex products--not to mention I can't turn the default ones OFF.

Therefore, I adapted a large amount of the Addresses module for CCK into a "Dimensions" module for CCK. (This adaptation allowed multiple sub-fields to be a part of the content without having to manage multiple individual fields for one Dimension attribute).

For instance: Exterior Dimensions would include: Height, Width, Depth; whereas, Cylindrical Dimensions would include: Height, Diameter or Radius.

The idea is that I can create a field for a content type which has any number of visible, hidden, required, or ignored fields: length, height, width, depth, radius, diameter in both metric and imperial units.

Best of all, the idea is to make the module's data searchable, allow tokens to facilitate easy display, and (if one exists) generate content in a properly formed micro-format.

The module also knows whether or not both Radius and Diameter have data and only displays one value -- so as not to confuse content viewers. Content editors/creators can supply both fields if they wish.

In this manner, the Dims module would integrate quickly with Views!

I have scoured the Drupal site for a "Dimensions" CCK module or similar contribution, with no results (the Measured Value Field CCK was both buggy and required WAYYYY too many other modules, not to mention, it cluttered the Edit Content Type form).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

I'm sorry, but where is the archive with the code to be reviewed?

wjaspers’s picture

FileSize
15.23 KB

Sorry about that; In the application, I didn't recognize a way to upload my DEV code.

Its not pretty, it has similar bugs to that of Addresses (since its the code I based this off of), and it may not yet meet Drupal's CVS standards... but here goes...

apaderno’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.

Dave Reid’s picture

Issue tags: +Ubercart

Tagging all CVS applications with ubercart-related code.

wjaspers’s picture

Status: Needs review » Postponed

No (present) time to continue development on this. Waiting to see what Drupal Commerce (created by Ubercart maintainers anyway) will bring to the table first.

wjaspers’s picture

Created uc_product_registration module. Code to follow tomorrow morning. Module supports registration on a global or per-product basis, includes views 2 support, permits administrators to restrict which product classes are registrable, and supports model/serial number checks using regular expressions on a global or per product basis. Requires ubercart 2.x, views 2.x, and that the uc_product module is enabled.

wjaspers’s picture

Status: Postponed » Needs review
FileSize
11.88 KB

Still needs a few tweaks to be perfect; but includes all the code thus far.

brianV’s picture

Status: Needs review » Needs work

Here's a few review points, although this is not a comprehensive review:

  1. Please remove the version line from the .info file.
  2. In the .install file,
    while( $r = db_fetch_array($q))
      variable_del($r['name']);    

    should be:

    while( $r = db_fetch_array($q))
    {
      variable_del($r['name']);
    }   

    (see http://drupal.org/coding-standards#controlstruct)

  3. Your commenting style doesn't comply with the coding standards either. ie,
      //
      // restrict control to delete a registered product
      //
    

    should be:

      // Restrict control to delete a registered product.
    

    Please review the coding standards section on comments at http://drupal.org/coding-standards#comment

  4. There seemed to be some coder errors as well - please run this module through coder (http://drupal.org/project/coder), and fix the flagged errors.
wjaspers’s picture

Status: Needs work » Needs review
FileSize
13.09 KB

Alright. Thanks for the feedback, updated everything according to the Coder module, worked out a few more small bugs, and cleaned up my comments.

brianV’s picture

Another suggestion (not an acceptance blocker, just a friendly suggestion):

Rather than loading the uc_product_registration.views.inc in hook_init() on every pageload, you could just put your hook_views_api() function in the .module file. This saves the .views.inc file from having to be loaded on pageviews where it isn't needed - Views will use the hook_views_api() file to find the location of it when it is needed.

I am leaving at 'Needs Review'. A quick look suggests this module is fine, but I don't have time to do a really in-depth review.

wjaspers’s picture

Great! I've posted the fix (as I found and solved another few bugs this afternoon). The module system (like Drupal) has quite a learning curve; but its getting easier!

wjaspers’s picture

Added one more bugfix: module didn't respect product classes for registration correctly.

wjaspers’s picture

Added more Views 2 support (including filters), a generic registration page (w/ Menu Item), an autocomplete field for the generic registration page, and started work on Rules support. Rules support needs a LOT of work.

wjaspers’s picture

Fixed a few more bugs; added Views support for the autocomplete field on the generic registration page. Nothing new for Rules support (still a work in progress). Fixed a couple misconceptions about NID/VID combinations. Added Token support. Added a default view to support the autocomplete field, will add additional support for it in later releases (if this is approved).

Passed Coder module standards.

wjaspers’s picture

Fixed a bug in my token support that was causing errors with strings.

Added demo site (http://ucpr.willjaspers.com) and screenshots (http://ucpr.willjaspers.com/screenshots).

wjaspers’s picture

Component: Miscellaneous » new project application
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.
wjaspers’s picture

Status: Postponed » Active

Check the sandbox, code should be available now: http://drupal.org/sandbox/wjaspers/1076268

wjaspers’s picture

Status: Active » Needs review
mlncn’s picture

Status: Needs review » Reviewed & tested by the community

wjaspers reacted promptly and well to BrianV's feedback back in the CVS days, has figured out all the hoops to jump through to actually get a review now, and the code looks good to me. Setting RTBC to give vetted git user access.

apaderno’s picture

Project: Drupal.org CVS applications » Drupal.org security advisory coverage applications
Component: new project application » module
Status: Reviewed & tested by the community » Needs review
Issue tags: -Ubercart, -Module review
greggles’s picture

@kiam, why did you move this from RTBC back to needs needs review?

Edit: I accidentally put an exclamation point on the end instead of a question mark - I meant it to be a question, not a yelling statement :)

wjaspers’s picture

I'm assuming because it switched queues--if there are any different review guidelines, it would need to be checked against them as well.

TR’s picture

Title: wjaspers [wjaspers] » Ubercart Product Registration

There are a lot of coding style/documentation problems. See http://drupal.org/coding-standards

Some of these problems are (in no particular order):

A lot of the files in this project are missing an EOL at the end.

Get rid of $Id$ - this was only needed for CVS

Documentation comments need work. See http://drupal.org/node/1354
For example:

"Implementation of" should be "Implements".
Formatting of function documentation blocks.
Missing comments for some functions.

hook_uninstall() has a block of commented-out code that should be removed.

$q = db_query("SELECT name FROM {variable} WHERE name LIKE 'uc_product_registration%'");
should be
$q = db_query("SELECT name FROM {variable} WHERE name LIKE 'uc_product_registration%%'");

Get rid of extra spaces, for example elseif ( !$nid ) { should be written as elseif (!$nid) {

There's lots of trailing whitespace in your code.

Ternary expressions like ($node->vid?$node->vid:NULL) should be written as code>($node->vid ? $node->vid : NULL)

I'll give it a functional review after all the code style and documentation style problems are cleaned up.

wjaspers’s picture

Thanks for taking time to look at it.
Some of the missing EOL's might be a result of using a windows based editor and forgetting to convert my line endings.
I'll do what I can to clean it up.

Even if Coder tells me to leave in // $Id$ is it safe to assume I can leave it out?

wjaspers’s picture

This should clean everything up for 6.x.
I'm working on a 7.x branch at work (still have a lot to learn about entities).
Code will be pushed to my git repo later.

I see that I missed a few compacted Ternary operators--easy fix later.

jordojuice’s picture

Issue tags: +PAReview: Ubercart

Adding UC application tags.

TR’s picture

@wjaspers: You should make your changes directly in the Git sandbox. Don't attach the changes as a ZIP here.

wjaspers’s picture

Ok, I updated my repo.

ccardea’s picture

Status: Needs review » Needs work

.install file - using unique keys where I think you want to be using primary key
registration date is a datetime but purchdate is char 20. What's the reason for this?
I've had problems using datetime in mysql. I wound up using an integer column to store unix timestamps, as some drupal core tables do. Have you tested this?

.module file

line 88: hook menu
- All you need in your doc block is 'Implements hook_menu'
- You don't need the $tree variable, and it isn't used anywhere
- $items['products/register/%'] - uses a place holder argument, but this is not included in your page arguments for this menu item. This makes me wonder if you've tested this module

Line 131 - Same documentation error as above. This is true for all hook implementations

Line 171 -uc_product_registration_checkanonymous() - drupal has a function for this: user_is_anonymous()

This is enough for now. There's quite a bit more review needed for this project.

wjaspers’s picture

Made significant progress cleaning up code.
Repo updated.
6.x-1.x branch created.

jthorson’s picture

Status: Needs work » Closed (duplicate)

It appears that you have successfully completed the application process with a different application, and been granted the 'create full projects' permission:

UC Add to Cart Block: http://drupal.org/node/1149550

Once their first application has been successfully approved, then an 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 other applications as 'closed(duplicate)'. If this is incorrect, and you do not yet have the ability to create full projects, then please feel free to re-open this application.

Thanks in advance for your patience and understanding!

wjaspers’s picture

I do have the "promote to full" permission. Thank you for updating this!

apaderno’s picture

Title: Ubercart Product Registration » [D6] Ubercart Product Registration
Issue summary: View changes
Issue tags: -
Related issues: +#1149550: [D7] UC Add to Cart Block