From 5b7e4b2a0b7ec6201d00be980b9768be8b311663 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 6 Apr 2016 14:23:38 +1200 Subject: [PATCH] CRM-18193 remove arbitrary setting of log_date when not provided. In order to be able to ignore the log_conn_date where it is not relevant the logging detail reports need to stop making up a log_conn_date where one is not provided. The code that does that was part of the inital report commit and on removing it I could not replicate any issues - ie. accessing the detail reports without criteria worked fine --- CRM/Logging/ReportDetail.php | 9 --------- templates/CRM/Logging/ReportDetail.tpl | 2 +- tests/phpunit/api/v3/ReportTemplateTest.php | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php index b35ef0e203..1f4f3c2f3a 100644 --- a/CRM/Logging/ReportDetail.php +++ b/CRM/Logging/ReportDetail.php @@ -90,15 +90,6 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $this->revert(); } - // make sure the report works even without the params - if (!$this->log_conn_id or !$this->log_date) { - $dao = new CRM_Core_DAO(); - $dao->query("SELECT log_conn_id, log_date FROM `{$this->db}`.log_{$this->tables[0]} WHERE log_action = 'Update' ORDER BY log_date DESC LIMIT 1"); - $dao->fetch(); - $this->log_conn_id = $dao->log_conn_id; - $this->log_date = $dao->log_date; - } - $this->_columnHeaders = array( 'field' => array('title' => ts('Field')), 'from' => array('title' => ts('Changed From')), diff --git a/templates/CRM/Logging/ReportDetail.tpl b/templates/CRM/Logging/ReportDetail.tpl index 379718a599..d900f943ce 100644 --- a/templates/CRM/Logging/ReportDetail.tpl +++ b/templates/CRM/Logging/ReportDetail.tpl @@ -43,7 +43,7 @@ {/if} {else}
-
  {ts}This report can not be displayed because there are no entries in the logging tables yet.{/ts} +
  {ts}This report can not be displayed because there are no relevant entries in the logging tables.{/ts}
{/if} {if $layout neq 'overlay'} diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index f25fa0be9d..ed3e3af0a9 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -185,9 +185,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'contribute/topDonor' => 'construction of query in postProcess makes inaccessible ', 'event/income' => 'I do no understand why but error is Call to undefined method CRM_Report_Form_Event_Income::from() in CRM/Report/Form.php on line 2120', 'logging/contact/summary' => '(likely to be test related) probably logging off Undefined index: Form/Contact/LoggingSummary.php(231): PHP', - 'logging/contact/detail' => '(likely to be test related) probably logging off DB Error: no such table', 'logging/contribute/summary' => '(likely to be test related) probably logging off DB Error: no such table', - 'logging/contribute/detail' => '(likely to be test related) probably logging off DB Error: no such table', 'contribute/history' => 'Declaration of CRM_Report_Form_Contribute_History::buildRows() should be compatible with CRM_Report_Form::buildRows($sql, &$rows)', 'activitySummary' => 'We use temp tables for the main query generation and name are dynamic. These names are not available in stats() when called directly.', ); -- 2.25.1