CVS edit link for kerberos

Hello.

My firm and I have been working with Drupal for the last year and have built a couple of modules that we use internally. Some of these modules have matured and we want to offer them back to the Drupal community. These modules are:

- Node histogram. This module is a Views plugin that allows you to select a particular field through a view and provides histogram statistics on the frequency of occurrence of all values within the field. It also allows you to separate out multiple values in the same field separated by some separation character (for example: "Apple, Orange" could be counted as Apple and Orange separately).

- Extended phone (CCK field). Similar to http://drupal.org/project/phone but allows to provide a label (main, mobile, fax etc.). Something the original module maintainers did not want to add. It's also more forgiving on the validation to allow for vanity numbers etc. 1-800-APPLE12

- A few other small CCK field modules. We need to evaluate for each whether it is worth contributing them and check if similar modules have appeared in the mean time. They circle around CCK type combinations (for example, have two text fields with customizable labels that can be used in multiple value arrangements - something CCK does not allow).

- Adulmec bar - this is a bit like the Wunderbar project that just got released. We started working on it before we knew about Wunderbar. Our goals are a bit different with the project (more flexibility, different use case, support for caching, better performance over eye candy). We will see if we can combine efforts with the project maintainers on things before we would contribute a separate project.

- OpenForis - A universal login system that allows people to share the same user name and password across multiple sites (not necessarily Drupal multisite or on the same server even). It's a bit like OpenID but more Drupal-like and allows to use regular usernames or email addresses to login.

- A few others are in the works as well.

In general, we share the goal of wanting to avoid project duplication over minor feature differences - nothing is more frustrating for users including us. We have also modified several existing projects internally and tried to contribute the improvements back to the projects. Not every maintainer was cooperative and some modules appear to have been abandoned. We would be willing to take over a few of these projects if that turns out to be indeed the case. We are also very excited about Drupal 7 and will release Drupal 7 versions of our modules in a timely fashion.

We have read the rules and will submit everything conforming to the coding standards (using Coder module and manual review). One of our employees is a long standing Drupal user (http://drupal.org/user/8662) and will be contributing OpenForis under his CVS account but the other projects are being maintained by other employees and we want to give them a separate CVS access.

Thank you very much for your time and consideration.

Comments

kerberos’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new16.49 KB
avpaderno’s picture

Issue tags: +Module review
kerberos’s picture

StatusFileSize
new6.4 KB

Here's one of the other modules we have been working on.

avpaderno’s picture

@kerberos: We just review a module / theme per applicant.

kerberos’s picture

Understood. My apologies. Please disregard. :)

-Daniel

avpaderno’s picture

Status: Needs review » Needs work

There is already a module with such functionality: http://drupal.org/project/appbar.

kerberos’s picture

Well, their approach is somewhat different. As they state on their project page:

"Note: Neither anonymous users nor users with JavaScript disabled in their browser will see the Appbar."

Ours is visible for all users (assuming they have the permission) and does not require JavaScript and aimed at providing a simple and highly theme-able way to link to your external links (although it can be used for internal links as well).

Lastly, our module just focuses on adding the links in a highly scalable way to the bottom bar. Appbar is aimed at internal site links and notifications and integrates with Views, Activity, Menu Icons, Rules, and the core Trigger module, so it's a fairly heavy-weight module for a simple task. It fits a very different need and I am not sure those needs can be reconciled.

avpaderno’s picture

  1. /**
     * Implementation of hook_theme().
     *
     * Returns information about every themable function defined by the module.
     */
    
    function theme_link_bar($links) {
      $output = '
       <div class="button" onclick="toggle();">X</div>
      <div id="bottomlinksbar">'. implode('&nbsp;', $links) .'</div>
      ';
      
      return $output;
    }
    function linkbar_theme() {
      $items = array();
      $items['linkbar_overview_form'] = array(
        'arguments' => array('form' => array()),
        'file' => 'linkbar.admin.inc',
      );
      $items['linkbar_record'] = array(
        'arguments' => array('record' => array()),
        'file' => 'linkbar.pages.inc',
      );
      $items['link_bar'] = array(
          'arguments' => array('links' => NULL),
        );
      
      return $items;
    }
    

    The comment refers to the second function, not the one directly below it. It would also be better to separate the functions with an empty line.

  2.   drupal_add_css(drupal_get_path('module', 'linkbar') . '/styles.css');
      drupal_add_js(drupal_get_path('module', 'linkbar') . '/js.js');
          
          if (($cache = cache_get('link_bar')) && !empty($cache->data)) {
            $output = $cache->data;
          }
          else {
      $links1 = db_query("SELECT link,content,title from {linkbar_record} ORDER BY weight"); 
      while ($row = db_fetch_array($links1)) {
      $linkuri[]= l(  '<div class="linkbar_icon"></div><span>' . $row['title'] . '</span>', $row['link'], $options = array('attributes' => array('target' => "_blank", 'class' => $row['content'] .' linkbar_link', 'title' => $row['title']), 'html' => TRUE));
      }
            $output = theme('link_bar', $linkuri);
            cache_set('link_bar', $output);
          }
      $block['content'] = $output;
    

    The indentation of the code is not correct; check also that you are using two spaces, and not a tab character.

  3.     'description' => t('Stores custom links to be added to nodes.'),
        'fields' => array(
          'record_id' => array(
    

    Schema descriptions should not be passed to t() anymore. See system_schema() for an example of what done by Drupal core code.

  4. function linkbar_update_6102() {
      $new_column = array(
            'type' => 'text',
            'not null' => FALSE,
             'size' => 'big',
            'description' => t('A description of the term.'),
          );
    
      $ret = array();
      db_add_field($ret, 'linkbar_record', 'link', $new_column);
      return $ret;
    }
    

    The update function is not executed when the module is first installed. As the module is not still hosted on drupal.org, you can remove that function.

  5. /**
     * Implementation of hook_uninstall().
     *
     * This hook is called when the already-disabled module is explicitly uninstalled
     * by the administrator -- simple disabling the module will trigger hook_disable().
     * It should delete any database tables added by the module, remove any variables
     * that are unique to the module, and clear out any cached data.
     */
    

    The comment should say Implements hook_uninstall() (as other hooks as well).

avpaderno’s picture

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

There have not been replies from the OP in the past 7 days. I am marking this report as won't fix.

kerberos’s picture

My apologies, I was gone for the holidays and still catching up with backlog from then. Can we reopen this or should we reapply?

Thanks.

avpaderno’s picture

Status: Closed (won't fix) » Needs work
kerberos’s picture

Please give us 7 days to respond. Thank you!

kerberos’s picture

StatusFileSize
new16.49 KB

I think we fixed everything. Let me know if there are any other issues. Many thanks.

-Daniel

avpaderno’s picture

Status: Needs work » Needs review

Remember to change the status, when you upload new code.

kerberos’s picture

My bad, thanks.

-Daniel

kerberos’s picture

We have a few other (probably more important) modules we'd love to contribute as well. Should we create new issues for these or wait for the review of this one?

-Daniel

avpaderno’s picture

Status: Needs review » Needs work
  1.   $schema['linkbar_record'] = array(
        'description' => t('Stores custom links to be added to nodes.'),
        'fields' => array(
          'record_id' => array(
            'type' => 'serial',
            'unsigned' => TRUE,
            'not null' => TRUE,
            'description' => t('Unique identifier for the {linkbar_record}.'),
          ),
    

    Database schema descriptions should not be passed to t(); see what done from Drupal core modules.

  2. See http://drupal.org/coding-standards to understand how a module should be written; in particular see the part about how the code should be formatted, and the character used as indentation.
  3. As the code has not been hosted on Drupal.org repository, the update function should not exist.
  4. function linkbar_record_load($record_id) {
      $sql = "SELECT * FROM {linkbar_record} WHERE record_id = %d";
      $result = db_query($sql, $record_id);
      if ($record = db_fetch_array($result)) {
        return $record;
      }
      else {
        return FALSE;
      }
    }
    

    As the function is just returning a record, the code should use db_query_range().

  5. The comments for hook implementations should be like the following one
     /**
      * Implements hook_theme().
      */
    
kerberos’s picture

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

Ok, I hope we fixed everything this time. Sorry for the many reviews. :(

-Daniel

kerberos’s picture

Anything we can do to help out with this?

Thanks.

Best,

-Daniel

kerberos’s picture

Just checking in...

We have 3 other projects (probably more needed by the community than this one) to contribute - but since we are not supposed to submit more than one, this is sort of holding everything up. :(

-Daniel

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

jcisio’s picture

Component: Miscellaneous » new project application
Status: Closed (fixed) » Active

Why the status changed to "fixed"? Was the applicant granted CVS permission?

avpaderno’s picture

Status: Active » Closed (fixed)

Yes, he did.
I change the status to fixed right before to approve a CVS account.

jcisio’s picture

Ok thanks, I just wanted to verify, as he hasn't any project or commit.

kerberos’s picture

Hi. Sorry, we have a few things almost ready to commit, but we are still coming up to speed with D7 and git.

Thanks.

-Daniel

avpaderno’s picture

Please don't use the CVS application issue to report issues with existing modules. The purpose of this queue is to document the process of approving a CVS account.

avpaderno’s picture

Issue summary: View changes

Set the comments to read only.