CVS edit link for trungonly

Hi CVS administrators,

Joined drupal.org for more than 2 years, but working in web dev for a long time, now I'd like to start to contribute my modules to the community.

The current completed module now is "Übercart CCK Attribute".

I got a lots of requests from community, my colleagues and myself, about an auto-generated Attribute options for Übercart 2.x.

See these threads:
http://drupal.org/node/443926
http://drupal.org/node/298361
http://drupal.org/node/333085

While current Attribute mechanism is manually data input, my attempt is making a way to connect between CCK Options and Attribute Options.

Übercart API allows us to do that smoothly.

I wrote the module with Drupal standard in mind. Using Coder helper tool to clean up the code. Install file for installing and uninstalling an additional DB table schema.

Please review and provide me the application issue queue for uploading my work.

Regards,
Trung

Comments

trungonly’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new10.62 KB
new5.78 KB
new3.75 KB
new5.67 KB
new3.69 KB

I'm adding attachment of the written module (uc_attribute_cck.tgz).

For your better imagine, I put here also some screenshots:

cck-attribute-product-content-type-settings.png Choose Content type for extracting CCK fields.
cck-attribute-product-add-to-cart.png Product Add to cart form with 2 CCK field options (Node reference )
cck-attribute-content-type-settings.png Setting field formatter for Teaser for displaying in Cart, Checkout and Order template.
cck-attribute-product-cart-with-formatter.png.
binhnt’s picture

that is great module! I thing it is very usefull for all people used ubercart!
Thanks!

trungonly’s picture

Issue tags: +Ubercart

Tag for Ubercart related module.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thank you 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.

As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site; for modules, it should include also a comparison with the existing solutions.
What is the difference with http://drupal.org/project/attribute?

trungonly’s picture

Status: Needs work » Needs review
StatusFileSize
new2.15 KB

Great.

... for modules, it should include also a comparison with the existing solutions.

There is no existing solution for current releases (2.x, 3.x) of Übercart.

- For your quoted competitor module:
http://drupal.org/project/attribute

Based on its related categories (Content · Content Construction Kit (CCK) · Content display · Views) and the description, I see this is not a module for Übercart. This is actually a plain CCK widget field. Users cannot use it for Übercart Attributes for Product, Cart and Order template.

Also, I cannot download it for deeper review, it says 404 not found right now.

See these outstanding issues:
#443926: Move product field ordering to standard field display management
#333085: Field weight order using CCK interface (attempted to patch)
#298361: Attributes -> CCK fields?

- There are plenty of people who need this request, but found no solution.
- The maintainers of Übercart mentioned that CCK Attribute will not be done officially in Übercart 2.x:

Moving to the 7.x-3.x queue.

And in Übercart official 3.x roadmap (if time permits):

Optional goals (We will include in 3.0 if time permits) ...
Move product field ordering to CCK manage fields.

As per requirements, the motivation message should be expanded to contain more features of the proposed project.

As per issue introduction, this module would be a replacement, independent (or working in parallel at the same time) with the core Übercart Attribute module. The advantages of (Übercart) CCK Attribute are:

  • Using *any* CCK field, not limited by only 4 field types of original Attribute. Include Node Reference, User Reference, or any other widget
  • Gathering any, dynamic data of Attibute Options
  • Able to use Views with any filter for dropdown/list of Options.

The disadvantage (currently) compared to the origin Übercart Attribute module is that, because of rich data the Options returned, it is not easy to manually set Price/cost/weight, Adjustment or Stock (yet). It could be solved specifically with Node Reference field type, by assigning specific node fields for Price/cost/weight, Adjustment or Stock (potential in next release).

I described everything in the README.txt file inside the module directory. That include introduction, instruction for how to install and configure and use. If you have not installed the module yet, please take a look at the README.txt file in the attachment.

Cheers,
Trung

avpaderno’s picture

Status: Needs review » Needs work
  • The points reported in this review are not in order of importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. License files cannot be committed in Drupal.org repository. Projects committed in Drupal.org repository have the same license used by Drupal.
  2. Menu descriptions and titles, as well as schema descriptions, should not be passed to t().
  3. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how Drupal variables, global variables, constants, and functions defined from the module should be named; how the code should be formatted.
trungonly’s picture

Status: Needs work » Needs review
StatusFileSize
new5.23 KB

Thanks for quick check.

1. I removed the License file. (I got this license file from the Ubercart module, that's just a clone of GPL from Ubercart).
2. I removed the t() now. (The menu title I got from the Ubercart Attribute module, with title passed to t(), yes this is not good).
3. The schema description is just a clone of the core Taxonomy module. Yes they are not passed to t() already.
4. I used the Coder helper module to find out errors. Read again the Coding standard specially in "Naming Conventions" section, found no mistake. Check again the recipe "CVS applications review, what to expect" and refine some - like you suggested. I believe I applied all experiences got from the recipe above. If you see anything buggy please kindly tell me!

I fixed also an issue about variable reference reported privately to me by fadiwissa.

fadiwissa’s picture

Thanks a lot Trung for the very quick update.

The warning message disappeared from the Product CCK Attribute tab.
However, I now see the same error message when I add a product containing a CCK Attribute to the ubercart cart.

Warning message: "warning: Parameter 1 to uc_attribute_cck_add_to_cart_data() expected to be a reference, value given in .../includes/module.inc on line 483"
and "warning: Parameter 1 to uc_attribute_cck_product_description() expected to be a reference, value given in .../includes/module.inc on line 483"

Would really appreciate it if you can resolve that.

Thanks Trung,
Fadi

fadiwissa’s picture

Trung, one more very useful feature would be the option to make the Product CCK Attribute required.
Thanks again,
Fadi

trungonly’s picture

StatusFileSize
new5.23 KB

This pass by reference warning is not happened in my server, so I cannot check it by myself. I modified all possible parameters into value, not reference anymore. Please check.

trungonly’s picture

Did you check the "required" option on CCK field configuration?

fadiwissa’s picture

My bad, like you mentioned checking the "required" option on the CCK field configuration works....

fadiwissa’s picture

The updated version you uploaded in post #10 resolved the last of my warnings.
Thanks Trung... great work.

fadiwissa’s picture

Hey Trung,
One final modification would make this module super useful IMHO - If you can make the product summary (in the cart) display the CCK Attribute value.
For example, if I selected product "X" and attribute value "Y", it would be great if I can see it as "X(Y)" in the ubercart cart.

Do you agree?

Thank you,
Fadi

trungonly’s picture

I checked all steps in the cart are displaying the pair Label: Option correctly (See screenshot "cck-attribute-product-cart-with-formatter.png" in post #1). Could you please tell me what cart step and screenshot of the page which is missing info.

fadiwissa’s picture

Thanks Trung.
It's working now. Unfortunately I'm not sure what I was doing wrong, but I believe it's probably related to the display settings of the field I wanted to display.
Thanks again,
Fadi

fadiwissa’s picture

Category: task » feature

Here's another recommended feature: exposing the custom attribute stored through a CCK field attribute to the view module...
This would enable module users to create a view displaying the orders along with the custom CCK field(s) value(s).

I have used the "Ubercart Views" module (http://drupal.org/project/uc_views) to expose UC_Order fields... but the "data" field where you're storing the information (as far as I can tell) is not exposed.
I'm guessing that's because the data field by design is maybe meant to contain unstructured data that the use decides to capture with the order...

Thanks again for an incredible module...
Fadi

avpaderno’s picture

Category: feature » task
trungonly’s picture

Status: Needs review » Needs work
StatusFileSize
new9.11 KB

Yes for your feature request I've made a View handler for CCK Attributes. The data structure of CCK Attributes is differ from original core Attributes, so you cannot use existing uc_view to handle CCK Attributes. It needs a new handler.

Since my View handler requires uc_view as dependency (I do not reinvent the wheel), I must split the View part into another separate sub - module. You please enable this sub - module if needed: Ubercart CCK Attribute Views.

Then choose the View field in group "Order product: Product CCK attributes".

Tell me if it suites your need or do you need anything else.

Note - this version is just a development release to collect your feedback. I need to refine & work on the filter part. So I'm making Status to needs work until final version (shortly now).

fadiwissa’s picture

StatusFileSize
new11.98 KB

Great work Trung.
I am now able to use the CCK fields in a view.

Two comments: It would be great if the user can specify which of the multiple CCK fields I want to show in a given column field (camper name vs camper age in the attached screenshot).
It would also be great if the user can filter/sort by a given CCK field.

Thanks Trung,
Fadi

trungonly’s picture

Status: Needs work » Needs review
StatusFileSize
new7.33 KB

This is the final improvement in Views support.

- View Fields:

  • Settings for show/hide Label.
  • Settings for display each separate field (as requested by fadiwissa).
  • Choose display format.

- No filter / sort implemented. I will back to it later when possible.

Please any CVS administrators review and approve my proposal. Thank you.

avpaderno’s picture

Status: Needs review » Fixed
project = "ubercart"

That line needs to be removed as it is already added from the packaging script, and it would cause problems to the update manager that would not understand which one is the project name, and could not verify if there are updates for the module.

Thank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

trungonly’s picture

Thanks for closing issue, I removed the line as you explain.

avpaderno’s picture

Assigned: Unassigned » avpaderno
trungonly’s picture

This's the 1st time I'm playing CVS stuff here.

It goes live now: http://drupal.org/project/uc_attribute_cck.

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart, -Module review

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

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes
avpaderno’s picture

Status: Closed (fixed) » Fixed

I am giving credits to the users who participated in this issue.

Status: Fixed » Closed (fixed)

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