Answers.Body: <p>This is fixed in newer versions</p>
  
  <p>//find the code change here.. every time you click on dashboard link, in the CRM/Case/Form/Search.php file line number368,369, its hard coded to 1. it needs to be $caseTpe(which is getting the actual case type value)</p>
  
  <pre><code> $this-&gt;_formValues['case_type_id'][$caseType] = 1;
    $this-&gt;_defaults['case_type_id'][$caseType] = 1;
  </code></pre>
  
  <p>change the above lines to use $caseType variable:</p>
  
  <pre><code>  $this-&gt;_formValues['case_type_id'][$caseType] = $caseType;
    $this-&gt;_defaults['case_type_id'][$caseType] = $caseType;
  </code></pre>
  
  <p>hope this helps some one</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-02T09:51:13.570Z
Answers.LastActivityDate: 2016-06-02T09:51:13.570Z
Answers.UserDisplayName: Developer
Body: <p>This works correctly on the Joomla demo server with 4.6.0, but not on my Joomla with CiviCRM 4.6.8.  Not sure if this is a problem with the more recent CiviCRM versions, or something else in my configuration.</p>
  
  <p>On the demo server, if you create cases in CiviCase, then go to the CiviCase dashboard, you can click on the numbers in the grid layout showing how many cases of what case type have what case status.  This works by adding parameters to the URL of &amp;status=2 and &amp;type=2 (for example).</p>
  
  <p>On my installation, the destination page seems to pick up status correctly, but even when type=3, it comes to a page giving an error that it couldn't find any cases, and shows the wrong search criteria for type:</p>
  
  <pre><code> No matches found for:
  Case Status(s) = Processing ...AND...
  Case Type(s) In 1 ...AND...
  Application = All Applications 
  </code></pre>
  
  <p>Why does it think I want case type of 1, when the URL specified type=3 ?</p>
  
  <p>If, from this screen, I select the Case type I want and click Search it gives a correct report as expected.  But it's very inconvenient to have those direct links from the dashboard not work.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-17T14:55:10.373Z
Comments.Text: This might be the type of problem where I'd use xdebug + netbeans (or other IDE)  and trace it to see what it's doing. It takes about 30-60 min to set up if you've never done it but if you're doing lots of customization it's worth it. https://netbeans.org/kb/docs/php/debugging.html
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-27T23:14:40.057Z
Comments.Text: I discovered that if the url uses &case_type_id=2 rather than &type=2 it works as expected.
Comments.UserDisplayName: Norris
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-27T23:20:46.050Z
Comments.Text: I discovered that if the url uses &case_type_id=2 rather than &type=2 it works as expected.  There are code changes between 4.6.0 and 4.6.8 in CRM/Case/BAO/Query.php which affect building of the case_type_id clause.  I can't figure out where that clause is now built...I assume that was changed to check the URL params for 'case_type_id' and Case/BAO/Case.php simply wasn't updated to make the correct URL parameters?
Comments.UserDisplayName: Norris
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-27T23:36:16.310Z
Comments.Text: I started an issue at https://issues.civicrm.org/jira/browse/CRM-17453
Comments.UserDisplayName: Norris
Tags: <civicase>
Title: Why don't links work from CiviCase Dashboard to filter by case type?
ThreadText: # Why don't links work from CiviCase Dashboard to filter by case type?
  
  (Asked by: username_0 on 2015-10-11)
  
  This works correctly on the Joomla demo server with 4.6.0, but not on my Joomla with CiviCRM 4.6.8.  Not sure if this is a problem with the more recent CiviCRM versions, or something else in my configuration.
  On the demo server, if you create cases in CiviCase, then go to the CiviCase dashboard, you can click on the numbers in the grid layout showing how many cases of what case type have what case status.  This works by adding parameters to the URL of &status=2 and &type=2 (for example).
  On my installation, the destination page seems to pick up status correctly, but even when type=3, it comes to a page giving an error that it couldn't find any cases, and shows the wrong search criteria for type:
   No matches found for:
  Case Status(s) = Processing ...AND...
  Case Type(s) In 1 ...AND...
  Application = All Applications 
  
  Why does it think I want case type of 1, when the URL specified type=3 ?
  If, from this screen, I select the Case type I want and click Search it gives a correct report as expected.  But it's very inconvenient to have those direct links from the dashboard not work.
  
  **Tags:** civicase
  
  > **Comments:**
  > **username_1**: This might be the type of problem where I'd use xdebug + netbeans (or other IDE)  and trace it to see what it's doing. It takes about 30-60 min to set up if you've never done it but if you're doing lots of customization it's worth it. https://netbeans.org/kb/docs/php/debugging.html  
  > **username_0**: I discovered that if the url uses &case_type_id=2 rather than &type=2 it works as expected.  
  > **username_0**: I discovered that if the url uses &case_type_id=2 rather than &type=2 it works as expected.  There are code changes between 4.6.0 and 4.6.8 in CRM/Case/BAO/Query.php which affect building of the case_type_id clause.  I can't figure out where that clause is now built...I assume that was changed to check the URL params for 'case_type_id' and Case/BAO/Case.php simply wasn't updated to make the correct URL parameters?  
  > **username_0**: I started an issue at https://issues.civicrm.org/jira/browse/CRM-17453  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-06-02. Score: 1
  
  This is fixed in newer versions
  //find the code change here.. every time you click on dashboard link, in the CRM/Case/Form/Search.php file line number368,369, its hard coded to 1. it needs to be $caseTpe(which is getting the actual case type value)
   $this->_formValues['case_type_id'][$caseType] = 1;
    $this->_defaults['case_type_id'][$caseType] = 1;
  
  change the above lines to use $caseType variable:
    $this->_formValues['case_type_id'][$caseType] = $caseType;
    $this->_defaults['case_type_id'][$caseType] = $caseType;
  
  hope this helps some one
  
  
  ---
  
  