On http://mysite.com/casetracker page, the filter options for Project always show only two options: and the last created project. All other projects are not seen on this filter field.

Trying to configure the 'Cases: Configure filter Case Tracker: Project' filter on /admin/build/views/edit/casetracker_project_cases also noticed there is only one option for the last created Project only.

CommentFileSizeAuthor
#5 casetracker_missing_nid_in_views.patch732 bytesdozymoe

Comments

tejaspmehta’s picture

I have same problem here. Any solution for this ?

yngens’s picture

Is Casetracker an abandoned project?

jmiccolis’s picture

@yngens, no it is not an abandoned project.

alex_shapka’s picture

jmiccolis, if it is not, why there is no reaction to this request for so long?

dozymoe’s picture

Status: Active » Needs review
StatusFileSize
new732 bytes

You have to edit casetracker_project_options' view instead (/admin/build/views/edit/casetracker_project_options).

This view should return two field, node's nid and node's title.

From casetracker.module line 939.

function casetracker_project_options() {
  $projects = array();
  // Fetch the views list of projects, which is space-aware.
  if ($view = views_get_view(variable_get('casetracker_view_project_options', 'casetracker_project_options'))) {
    $view->set_display();
    $view->set_items_per_page(0);
    $view->execute();
    foreach ($view->result as $row) {
      $projects[$row->nid] = $row->node_title;
    }
  }
  return $projects;
}

The default casetracker_project_options' view only have "title" field (for $row->node_title) in the list of fields, missing a "nid" field (for $row->nid).

yngens’s picture

Status: Needs review » Reviewed & tested by the community

Excellent, dozymoe! Your patch worked for me. The only thing I needed for the patch to take effect is to run update.php and cron.

jvieille’s picture

Perfect.
Warning: this only works witn OG when setting a default argument "Node ID from URL" in views "casetracker_project_options" - should be written somewhere.

jvieille’s picture

Issue summary: View changes

spelling correction