Download & Extend

Filter options for Project always show <Any> and the last created project only

Project:Case Tracker
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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.

Comments

#1

I have same problem here. Any solution for this ?

#2

Is Casetracker an abandoned project?

#3

@yngens, no it is not an abandoned project.

#4

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

#5

Status:active» needs review

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.

<?php
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).

AttachmentSize
casetracker_missing_nid_in_views.patch 732 bytes

#6

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.

#7

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.