I see in issue.inc that there is commentary on a method for injecting outside data to the main table of data at the top of an issue page, however I can't figure out just how to do this. I tried using a theme override until I realized that that was probably targeting the wrong thing. I've done some research on hooks but haven't come up with anything helpful.

Basically I want to add two lines, which I've added as fields via cck, onto the main table of data about the issue instead of allowing them to display on their own, separate from the rest of the data.

Comments

aclight’s picture

Status: Active » Fixed

From issue.inc in the function project_issue_view():

    // Allow modules to alter the metadata displayed in the table on the actual
    // issue node itself (at the very top of the issue). Modules should accept
    // the $current_data parameter by reference and add additional
    // elements for additional lines in the table.
    //
    // Modules implementing this hook should take the following parameters:
    // @param $view
    //  A string representing the metadata view being generated.  For the issue
    //  node main table, this will be 'current'.
    // @param $node
    //  The project_issue node object.
    // @param $current_data
    //  An associative array of rows in the project issue metadata table that
    //  will be displayed, with the following key/value pairs:
    //    'label' => The metadata label.
    //    'current' => The current metadata value.
    //  This parameter should be accepted by reference.
    foreach (module_implements('project_issue_metadata') as $module) {
      $function = $module .'_project_issue_metadata';
      $function('current', $node, $current_data);
    }

So, just implement this hook. For example,

function my_module_name_project_issue_metadata($view, $node, &$current_data) {
  if ($view != 'current') {
    return;
  }

  $current_data['my_new_property'] = array(
    'label' => 'My label',
    'value' => 'my value',
  );
}
Anonymous’s picture

Status: Fixed » Closed (fixed)

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