Fix the display of the bottom tablesorter pager on page load (see Tiki issue #7097)
The issue with endRow is explained in the ticket's description.
===
Should be upstream
===
Index: lib/core/Table/Code/Bind.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/core/Table/Code/Bind.php	(date 1560867154758)
+++ lib/core/Table/Code/Bind.php	(date 1560867154758)
@@ -30,13 +30,12 @@
 			$bindtr = [
 				//re-binding in some cases since ajax tbody refresh disconnects binding
 				'$(\'' . parent::$tid . '\').tiki_popover();',
-				'if (this.config.pager.endRow - this.config.pager.startRow > 15) {',
-				'	$(\'div#' . parent::$s['pager']['controls']['id']
-				. '.ts-pager-bottom\').css(\'display\', \'block\');',
-				'} else {',
-				'	$(\'div#' . parent::$s['pager']['controls']['id']
-				. '.ts-pager-bottom\').css(\'display\', \'none\');',
-				'}',
+				'if (this.config.pager.endRow == 0' . /* Play safe and display when endRow's value is clearly wrong. This does happen, when this executes too early. */' || this.config.pager.endRow - this.config.pager.startRow > 15) {'
+				. '	var display = "block";'
+				. '} else {'
+				. '	var display = "none";'
+				. '}',
+				'$(\'div#' . parent::$s['pager']['controls']['id'] . '.ts-pager-bottom\').css(\'display\', display);',
 			];
 		}
 		if (parent::$ajax) {
