Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mecmartini/4780731300c5165500c563806f0f18a6 to your computer and use it in GitHub Desktop.
Save mecmartini/4780731300c5165500c563806f0f18a6 to your computer and use it in GitHub Desktop.
peneuropa/oe_theme fix pager
diff --git a/oe_theme.theme b/oe_theme.theme
index dc0f98df..d8d0ddfe 100644
--- a/oe_theme.theme
+++ b/oe_theme.theme
@@ -444,6 +444,9 @@ function oe_theme_preprocess_pager(array &$variables): void {
$route_name = $variables['pager']['#route_name'];
$route_parameters = $variables['pager']['#route_parameters'] ?? [];
global $pager_page_array, $pager_total;
+ if (!$pager_total) {
+ return;
+ }
// Maximum page number for this pager.
$pager_max = $pager_total[$element];
// Nothing to do if there is only one page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment