Custom subpanel pagination does not work in version 7.8.2

When loading a subpanles with a custom query the page does not load the next result.

Before migrating to version 7.8.2 the custom subpanel paging works correctly.

My code that loads the subpanels is:


<?php //QYS $layout_defs['Contacts']['subpanel_setup']['afiliado_qys'] = array('order' => 50, 'module' => 'Cases', 'subpanel_name' => 'Contact_subpanel_afiliado_qys', 'get_subpanel_data' => 'function:get_afiliado_qys', 'generate_select' => true, 'title_key' => 'LBL_AFILIADO_QYS', 'top_buttons' => array(array('widget_class' => 'SubPanelTopCreateButton')), //'top_buttons' => array(array('widget_class' => 'SubPanelTopButtonQuickCreate',)), 'function_parameters' => array( 'import_function_file' => 'custom/modules/Contacts/querys_subpanel_afiliados_qys.php', 'afiliado_id' => $this->_focus->id, 'return_as_array' => 'true' ), ); ?>


<?php //QUERYS Subpanel qys function get_afiliado_qys($params) { $args = func_get_args(); $afiliadoId = $args[0]['afiliado_id']; $afiliado = new Contact(); $afiliado->retrieve($afiliadoId); $numero_de_afiliado_c = $afiliado->numero_de_afiliado_c; //QUERY QUE CARGA EL SUBPANEL $return_array['select'] = " SELECT "; $return_array['from'] = " FROM cases AS cases "; $return_array['where'] = " WHERE cases_c.parent_type='Contacts' AND cases_c.numero_de_afiliado_c='{$numero_de_afiliado_c}' AND cases_c.tipo_de_gestion_c='QYS'"; $return_array['join'] = " INNER JOIN cases_cstm AS cases_c ON = cases_c.id_c AND cases.deleted = 0"; $return_array['join_tables'] = ""; // print_r($return_array['select'].''.$return_array['from'].''.$return_array['join'].''.$return_array['where']); return $return_array; } ?>

any solution?

Hi Matias,

Im not sure but maybe the problem is you are returning an empty array. I was trying your code and it returns an empty select because the last return_array is equals to an empty string and you are clearing all the previous values.

You can use something like this:

$return_array[‘select’]=" SELECT “;
$return_array[‘from’]=” FROM cases AS cases “;
$return_array[‘where’]= " WHERE cases_c.parent_type=‘Contacts’ AND cases_c.numero_de_afiliado_c=’{$numero_de_afiliado_c}’ AND cases_c.tipo_de_gestion_c=‘QYS’”;

return $return_array;