Skip to main content
formatting got messed up
Source Link
Demerit
  • 24.7k
  • 2
  • 12
  • 34

This looks like a bug. It's coming from CRM_Case_Page_Tab::preProcess(), which calls CRM_Case_BAO_Case::getCases(), which then returns a list that's keyed sequentially, but then preProcess checks for a key that matches the case id, so there is no match. I'll file a bug report.

$userCases = CRM_Case_BAO_Case::getCases(FALSE, array('type' => 'any'));
if (!array_key_exists($this->_id, $userCases)) {
  CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}

This appears to have inadvertently been changed as part of CRM-21461. I'll file a bug report.

This looks like a bug. It's coming from CRM_Case_Page_Tab::preProcess(), which calls CRM_Case_BAO_Case::getCases(), which then returns a list that's keyed sequentially, but then preProcess checks for a key that matches the case id, so there is no match. I'll file a bug report.

$userCases = CRM_Case_BAO_Case::getCases(FALSE, array('type' => 'any'));
if (!array_key_exists($this->_id, $userCases)) {
  CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}

This looks like a bug. It's coming from CRM_Case_Page_Tab::preProcess(), which calls CRM_Case_BAO_Case::getCases(), which then returns a list that's keyed sequentially, but then preProcess checks for a key that matches the case id, so there is no match.

$userCases = CRM_Case_BAO_Case::getCases(FALSE, array('type' => 'any'));
if (!array_key_exists($this->_id, $userCases)) {
  CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}

This appears to have inadvertently been changed as part of CRM-21461. I'll file a bug report.

edited for the real cause after running a debugger
Source Link
Demerit
  • 24.7k
  • 2
  • 12
  • 34

It seems to have changed over the years and there's been similar issues before but what it appears to be doing in 5This looks like a bug.3 in this situation is ultimately calling return (bool) civicrm_api3('Case', 'getcount', $params); in It's coming from CRM_Case_Page_Tab::preProcess(), which calls CRM_Case_BAO_Case::accessCasegetCases(), which then returns a list that's keyed sequentially, but without further tracing it's not immediately obvious even wherethen preProcess checks for a key that api call goesmatches the case id, so there is no match. When I have time I can look closer - I'm curious myself how it currently works exactlyI'll file a bug report.

$userCases = CRM_Case_BAO_Case::getCases(FALSE, array('type' => 'any'));
if (!array_key_exists($this->_id, $userCases)) {
  CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}

It seems to have changed over the years and there's been similar issues before but what it appears to be doing in 5.3 in this situation is ultimately calling return (bool) civicrm_api3('Case', 'getcount', $params); in CRM_Case_BAO_Case::accessCase(), but without further tracing it's not immediately obvious even where that api call goes. When I have time I can look closer - I'm curious myself how it currently works exactly.

This looks like a bug. It's coming from CRM_Case_Page_Tab::preProcess(), which calls CRM_Case_BAO_Case::getCases(), which then returns a list that's keyed sequentially, but then preProcess checks for a key that matches the case id, so there is no match. I'll file a bug report.

$userCases = CRM_Case_BAO_Case::getCases(FALSE, array('type' => 'any'));
if (!array_key_exists($this->_id, $userCases)) {
  CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
Source Link
Demerit
  • 24.7k
  • 2
  • 12
  • 34

It seems to have changed over the years and there's been similar issues before but what it appears to be doing in 5.3 in this situation is ultimately calling return (bool) civicrm_api3('Case', 'getcount', $params); in CRM_Case_BAO_Case::accessCase(), but without further tracing it's not immediately obvious even where that api call goes. When I have time I can look closer - I'm curious myself how it currently works exactly.