CVS edit link for VVVi

I would like to maintain CJunction module. This project is an implementation of the Commission Junction's API for Drupal. Using this Drupal module you can easily promote products from the huge database of Commission Junction’s Affiliate and Merchant Network.

I have been searching for a similar Drupal module, but didn't find one, so I believe this is original functionality. Similar modules exist for WP: wpCJ, CJNiche. I know that others are looking for a module like this, and I want to make this available to the community.

Comments

vvvi’s picture

StatusFileSize
new7.52 KB

This is my module. I was write it for Drupal 7.

avpaderno’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 your code, pointing out what needs to be changed.

vvvi’s picture

StatusFileSize
new7.51 KB

I have made some improvements. Please review that module. Thanks

vvvi’s picture

StatusFileSize
new7.93 KB

Attached is an update to my proposed module.

I appreciate your review

vvvi’s picture

Please, could anyone review my module?

Thank you very much

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Drupal 7.x
  • The points reported in this review are not in order or 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. version = "7.x-0.0-dev"
    project = "cjunction"
    

    Those lines need to be removed from the file.

  2. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how the code should be formatted.
  3. function theme_cjunction_image_url($variables) {
      $output = '<img height="100px" src="' . $variables['image_url'] . '" >';
    	
      return $output;
    }
    
    

    Drupal has a theme function for images.

  4.   $form['associate_setting']['cjunction_developer_key'] = array(
        '#type' => 'textfield',
        '#title' => t('Developer Key'),
        '#description' => t('Register for a !more_info. (Note: Registration requires an existing account in the Commission Junction network.)', array('!more_info' => l(t('developer key'), 'https://api.cj.com/sign_up.cj', array('html' => TRUE)))),
        '#default_value' => variable_get('cjunction_developer_key', ''),
    		'#maxlength' => 300,
        '#required' => TRUE,
      );
    
    

    l() should not be used together with t(). See the documentation for t(), where this code is reported to be wrong:

    $output .= t('<p>Go to the @contact-page.</p>', array('@contact-page' => l(t('contact page'), 'contact')));
    

    The correct code to use is the following:

    $output .= '<p>'. t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) .'</p>';
    
vvvi’s picture

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

kiamlaluno, thank you very much for your review and valuable advices!

I attached the updated module.

avpaderno’s picture

Status: Needs review » Fixed
  1. t() is available when hook_install(), or hook_uninstall() are invoked. See the code executed from php_install() as example.

Status: Fixed » Closed (fixed)
Issue tags: -Module review, -Drupal 7.x

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

Assigned: Unassigned » avpaderno
Issue tags: -Drupal 7.x