diff --git a/Classes/Lib/Sorting.php b/Classes/Lib/Sorting.php
index <HASH>..<HASH> 100644
--- a/Classes/Lib/Sorting.php
+++ b/Classes/Lib/Sorting.php
@@ -116,6 +116,9 @@ class Sorting
                         $sortByDir = $this->changeOrdering($sortByDir);
                     }
 
+                    $url = $this->generateSortingLink($field, $sortByDir);
+                    $classname = $this->getClassNameForUpDownArrow($field, $dbOrdering);
+
                     $fluidTemplateVariables['sortingLinks'][] = array(
                         'field' => $field,
                         'url' => $url,
[BUGFIX] fix sorting links