UC Order Update Attribute allows Admin to update the attribute of the product purchased through the order. Update Product Attribute is very easy to install and use.

This module creates a pane in order form to View, Edit attribute on the order page. In edit order this gives a selection option for the attributes with currently selected attribute value as a default value.

This module currently does provide the functionality to view, update the attribute in the order with following assumptions:

On updating the attribute has no impact on the total amount of the order placed.
Each product has only one attribute.

Project Page:
http://drupal.org/sandbox/srahul07/1711794

Git Repository Link:
git clone http://git.drupal.org/sandbox/srahul07/1711794.git uc_order_update_attribute

Drupal Version: 6

Comments

patrickd’s picture

Status: Needs review » Needs work

welcome,

You are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.

As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow the tips for a great project page. Also create a README.txt that follows the guidelines for in-project documentation.

An automated review of your project has found some issues with your code; As coding standards make sure projects are coded in a consistent style we please you to have a look at the report and try to fix them. Anyway, note that issues found are possibly false positives and fixing all issues is not a requirement for getting through the application process.
Report: http://ventral.org/pareview/httpgitdrupalorgsandboxsrahul071711794git

We do 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.

regards

swarad07’s picture

Hi Rahul,

I would recommend adding dev branches first, you could start of with a dev branch and can use it to tag your stable versions as you go ahead.

Manual Review of master branch.

Issues I found,

  • Create branches (not a issue but something to look into)
  • Resolve add "_module_name" to your internal functions so no one overrides them
  • http://ventral.org/pareview/httpgitdrupalorgsandboxsrahul071711794git
  • Is Ubercart - core (optional) package necessary, it can go in ubercart recurring or ubercart extra if it is be more generic
  • Line #32 in .module, initialize $panes = array();
  • Consider a Theme function to wrap HTML around your output so that other modules can do stuff with the HTML if needed, this way your module will provide other modules to override it instead of changing your module's code. You can look into this How to use Drupal 6 theme layer
  • Line #96 , consider t()
  • Line #127, use format strings instead of " . " in t()

Cheers,
swarad07

yogeshchaugule8’s picture

Hi Rahul,

  • Quotes ("") are not required for name attribute in .info file (coder module might not able to locate your module. I came to this while reviewing your module)
  • While including file please prefer to add drupal_get_path() on line #12

Yogesh

srahul07’s picture

Status: Needs work » Needs review

Thanks Guys.

@patrickd: Thank you for comments. I will look into the documentation part and will complete it soon.

@swarad07: Can you please elaborate more on theme functions. And where should I use it. Also, I added package name "Ubercart - core (optional)" since, Ubercart Attributes is required for this module which is a part of "Ubercart - core (optional)".

@yogeshchaugule8: Thank You. Have committed this changes.

Current Updated:

  1. Added Logic to include multiple Attributes of a product
  2. Updated with Comments given by Swarad07 and yogesh chaugule
  3. Created a new Dev branch: 6.x-dev

Regards,

Rahul

tr’s picture

Status: Needs review » Needs work

6.x-dev is an invalid branch name. See http://drupal.org/node/1015226
You won't be able to make any releases from this branch. It should be 6.x-1.x.

There are still many, many coding and documentation standards problems. See http://ventral.org/pareview/httpgitdrupalorgsandboxsrahul071711794
You need to clean up those errors.

srahul07’s picture

Status: Needs review » Needs work

Hi All,

I have updated the code base with the drupal standards and have verified it from ventral.org.

Please check here: http://git.drupal.org/sandbox/srahul07/1711794.git Over
http://ventral.org/pareview/httpgitdrupalorgsandboxsrahul071711794git

srahul07’s picture

Status: Needs work » Needs review

Changing the status

dSero’s picture

Dear Rahul,

Very interesting module, that I believe that many will find interest in it.
I made the automatic check and everything looks fine.

You may consider the following issues:
1. There is nothing in the .install. Do you do nothing during installation?
2. commerce_stock_status_entity_property_info_alter(): from security point of view it's better to make the if and return, rather than the opposite:
if (empty($info['commerce_product']['bundles'])) {
return;
}

if (!isset($properties['commerce_stock_status'])) {
return;
}
3. Same at commerce_stock_status_field_update_default_value():
if (empty($default_value) || empty($instance['default_value'])) {
return;
}

P.S consider applying for the review bonus to accelerate your review: http://drupal.org/node/1410826

Best Regards,
Moshe

srahul07’s picture

Status: Needs work » Needs review

Hi dSero,

Thank you for your comments. But as far as this module is concern, none of the lines or snippets you mentioned are present the code? From where you found them? That part of the code is somewhere outside of this module?

sadashiv’s picture

Status: Needs review » Needs work

Nice module.

Coder module showed minor warnings.

uc_order_update_attribute.module

    severity: minorLine 29: Format should be * Implementation of hook_foo().

     * Implements of hook_order_pane().

    severity: minorLine 210: Potential problem: use the Form API to prevent against CSRF attacks. If you need to use $_POST variables, ensure they are fully sanitized if displayed by using check_plain(), filter_xss() or similar. (Drupal Docs)

            $post_products = _uc_order_update_attribute($product_model, $attribute, $order['order_id'], $_POST['products']);

Would be nice if you write hook_help and add contents of README.txt, you may refer http://drupal.org/node/161085

PA robot’s picture

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

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Updating formattingand anding coding style to git repository