From 77586a65a1c3bf18ceba5e7bf8adfbc91a16f100 Mon Sep 17 00:00:00 2001 From: "Jehan-Guillaume (ioguix) de Rorthais" Date: Tue, 11 Sep 2012 15:23:43 +0200 Subject: [PATCH] Fix a bug with empty actions column when browsing data When no action is allowed (eg. when GuiControl removes them) on the browsing page (display.php), the "action" header was still showed, but not its data column, leading to a difference between the number of header columns and data columns. This bug was raised by Julien Rouhaud (rjuju). This patch is based on his work (some cleanup). --- display.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/display.php b/display.php index 5551500a..82c95aff 100644 --- a/display.php +++ b/display.php @@ -565,12 +565,14 @@ ); } - $edit_params = $actions['actionbuttons']['edit']; - $delete_params = $actions['actionbuttons']['delete']; + $edit_params = isset($actions['actionbuttons']['edit'])? + $actions['actionbuttons']['edit']:array(); + $delete_params = isset($actions['actionbuttons']['delete'])? + $actions['actionbuttons']['delete']:array(); // Display edit and delete actions if we have a key $colspan = count($buttons); - if (sizeof($key) > 0) + if ($colspan > 0) echo "{$lang['stractions']}\n"; /* we show OIDs only if we are in TABLE or SELECT type browsing */ @@ -584,7 +586,7 @@ $id = (($i % 2) == 0 ? '1' : '2'); echo "\n"; // Display edit and delete links if we have a key - if (sizeof($key) > 0) { + if ($colspan > 0 and count($key) > 0) { $keys_array = array(); $has_nulls = false; foreach ($key as $v) { -- 2.39.5