From 85c975f27fadd3c1448a56f533f3d861156f1e62 Mon Sep 17 00:00:00 2001 From: Lakshay arora Date: Thu, 15 Feb 2018 00:13:02 +0530 Subject: [PATCH] Fix for issue #13439 Problem 1: The number of td elements in the zoom search form table were insufficient, due to which, the field_type(element #types_$) was getting replaced with field_value(element td:eq(3))(see ./js/tbl_zoom_jqplot.js lines 164, 188, 211, 232). Added a td element in the table for each row. Problem 2: The events attached to 'tableid_$' were inserting the values in wrong tr elements(see ./js/tbl_zoom_jqplot.js lines 185-188, 208-211, 229-232), leading to wrong values being passed to the zoom search. Signed-off-by: Lakshay arora --- js/tbl_zoom_plot_jqplot.js | 24 ++++++++++++------------ templates/table/search/rows_zoom.twig | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/js/tbl_zoom_plot_jqplot.js b/js/tbl_zoom_plot_jqplot.js index f6c67e1e6f..897caed666 100644 --- a/js/tbl_zoom_plot_jqplot.js +++ b/js/tbl_zoom_plot_jqplot.js @@ -182,10 +182,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { 'field' : $('#tableid_1').val(), 'it' : 1 }, function (data) { - $('#tableFieldsId').find('tr:eq(3) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(3) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(3) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(3) td:eq(3)').html(data.field_value); + $('#tableFieldsId').find('tr:eq(2) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(2) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(2) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(2) td:eq(3)').html(data.field_value); yLabel = $('#tableid_1').val(); $('#types_1').val(data.field_type); yType = data.field_type; @@ -205,10 +205,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { 'field' : $('#tableid_2').val(), 'it' : 2 }, function (data) { - $('#tableFieldsId').find('tr:eq(6) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(6) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(6) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(6) td:eq(3)').html(data.field_value); + $('#tableFieldsId').find('tr:eq(4) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(4) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(4) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(4) td:eq(3)').html(data.field_value); $('#types_2').val(data.field_type); $('#collations_2').val(data.field_collations); addDateTimePicker(); @@ -226,10 +226,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { 'field' : $('#tableid_3').val(), 'it' : 3 }, function (data) { - $('#tableFieldsId').find('tr:eq(8) td:eq(0)').html(data.field_type); - $('#tableFieldsId').find('tr:eq(8) td:eq(1)').html(data.field_collation); - $('#tableFieldsId').find('tr:eq(8) td:eq(2)').html(data.field_operators); - $('#tableFieldsId').find('tr:eq(8) td:eq(3)').html(data.field_value); + $('#tableFieldsId').find('tr:eq(5) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(5) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(5) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(5) td:eq(3)').html(data.field_value); $('#types_3').val(data.field_type); $('#collations_3').val(data.field_collations); addDateTimePicker(); diff --git a/templates/table/search/rows_zoom.twig b/templates/table/search/rows_zoom.twig index 4cafaadf1a..79ef78f384 100644 --- a/templates/table/search/rows_zoom.twig +++ b/templates/table/search/rows_zoom.twig @@ -55,6 +55,8 @@ {{ func[i] is defined ? func[i]|raw }} {# Inputbox for search criteria value #} + + {{ value[i] is defined ? value[i]|raw }} {# Displays hidden fields #}