From 09b7b9b82d05b01339fd311f8a5d657a882798af Mon Sep 17 00:00:00 2001 From: Arne Morken Date: Wed, 27 Nov 2024 20:46:59 +0100 Subject: [PATCH] Make sure top level always has a type also when it not has a header --- data/mysql/anyTable.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data/mysql/anyTable.php b/data/mysql/anyTable.php index da9adb4..e5fd26b 100644 --- a/data/mysql/anyTable.php +++ b/data/mysql/anyTable.php @@ -1804,12 +1804,11 @@ public function prepareData($id=null) $topidx = "+".$id; $data = array("data" => array($topidx => array())); - // Set header and "head" + // Set "head" and header + $data["data"][$topidx]["head"] = $this->mType; $hdr = $this->findHeader($this->mType,$this->mData,$id); - if (isset($hdr) && $hdr != "") { - $data["data"][$topidx]["head"] = $this->mType; + if (isset($hdr) && $hdr != "") $data["data"][$topidx][$this->mNameKey] = $hdr; - } // Set data if (isset($this->mData)) {