From 0160993aa526b409d948c6e442ccab04bb7fbac0 Mon Sep 17 00:00:00 2001 From: Matheus Zych Date: Mon, 21 Oct 2024 09:54:46 +0200 Subject: [PATCH] Fixes being unable to sort table records by columns that are not shown by default --- .../ILIAS/UI/src/Implementation/Component/Table/Data.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php index bcf27af0b114..04b49a9bf241 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php @@ -125,8 +125,8 @@ public function applyViewControls( $view_controls = $this->getViewControls($total_count); if ($request = $this->getRequest()) { - $view_controls = $this->applyValuesToViewcontrols($view_controls, $request); - $data = $view_controls->getData(); + # This retrieves container data from the request + $data = $this->applyValuesToViewcontrols($view_controls, $request)->getData(); $range = $data[self::VIEWCONTROL_KEY_PAGINATION]; $range = ($range instanceof Range) ? $range->croppedTo($total_count ?? PHP_INT_MAX) : null; $order = $data[self::VIEWCONTROL_KEY_ORDERING]; @@ -136,6 +136,8 @@ public function applyViewControls( ->withRange($range) ->withOrder($order) ->withSelectedOptionalColumns($data[self::VIEWCONTROL_KEY_FIELDSELECTION] ?? null); + # This retrieves the view controls that should be displayed + $view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request); } return [