From 2ea4330033d53012f948e141ad07cdc73e33358c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 24 Feb 2015 19:35:42 +0000 Subject: [PATCH] Fix infolog home portlet --- infolog/inc/class.infolog_favorite_portlet.inc.php | 10 ++++++++++ infolog/inc/class.infolog_ui.inc.php | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_favorite_portlet.inc.php b/infolog/inc/class.infolog_favorite_portlet.inc.php index 3408687ac1..97cf6bbfa4 100644 --- a/infolog/inc/class.infolog_favorite_portlet.inc.php +++ b/infolog/inc/class.infolog_favorite_portlet.inc.php @@ -63,6 +63,16 @@ class infolog_favorite_portlet extends home_favorite_portlet */ public static function get_rows(&$query, &$rows, &$readonlys) { + // Make sure we pass the type check + if ($query['col_filter']['info_type']) + { + $tpl = new etemplate_new; + if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) + { + $query['template'] = $tpl->name; + $query['custom_fields'] = true; // read the custom fields too + } + } $ui = new infolog_ui(); $total = $ui->get_rows($query, $rows, $readonlys); // infolog_ui overwrites what we set in constructor diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 93e942043f..9970350346 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -388,7 +388,12 @@ class infolog_ui // check if we have a custom, type-specific template $old_template = $query['template']; - $query['template'] = 'infolog.index.rows'; + + // Reset custom, type-specific template if type was cleared (without changing it for home) + if(!$query['template'] || stripos($query['template'], 'infolog.index.rows') === 0) + { + $query['template'] = 'infolog.index.rows'; + } unset($query['custom_fields']); if ($query['col_filter']['info_type']) {