Skip to content

Commit

Permalink
Issue techjoomla#172 Fix: Notice: Undefined index in reports model & …
Browse files Browse the repository at this point in the history
…reports default view
  • Loading branch information
niteshkesarkar committed Jan 3, 2020
1 parent 8f09f45 commit 2edc602
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tjreports/site/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function setCustomFieldsColumns()
foreach ($columnNames as $columnName)
{
$customField = array (
'title' => ($columnLabels[$columnName]) ? $columnLabels[$columnName] : $columnName,
'title' => isset($columnLabels[$columnName]) ? $columnLabels[$columnName] : $columnName,
'table_column' => $this->customFieldsTableAlias . '.' . $columnName,
'not_show_hide' => false
);
Expand Down Expand Up @@ -542,13 +542,13 @@ protected function populateState($ordering = '', $direction = 'ASC')
if (empty($colToshow))
{
$reportParams = $this->getReportParams($reportId);

$colToshow = $reportParams->get("colToshow");
$piiColumns = array_flip($reportParams->get("piiColumns"));
$colToshow = (array) $reportParams->get("colToshow");
$piiColumns = (array) $reportParams->get("piiColumns");
$piiColumns = array_flip($piiColumns);

if (!empty($piiColumns))
{
$colToshow = (object) array_diff_key((array) $colToshow, $piiColumns);
$colToshow = (object) array_diff_key($colToshow, $piiColumns);
}
}

Expand Down
3 changes: 2 additions & 1 deletion tjreports/site/views/reports/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@
else
{
$isSendEmailClass = ($key == $this->emailColumn) ? $emailColmClass : '';
echo "<td class=\"{$key} {$isSendEmailClass} \">{$item[$key]}</td>";
$value = isset($item[$key]) ? $item[$key] : '';
echo "<td class=\"{$key} {$isSendEmailClass} \">{$value}</td>";
}
}

Expand Down

0 comments on commit 2edc602

Please sign in to comment.