In my setup, alpha pager throws out the error message: Alpha Pager called with no defined query on top, and items are displayed in a standard (numerically paged) way.
It seems to me that queries are not initialized properly, so here is my proposed patch (well, the first "correction" was introduced by a coincidence and is absolutely unnecessary, but I was too lazy to remove it; in any case, blank spaces are not necessary in empty lines all over...):
--- views_alpha_pager.module.ORIG 2007-02-16 14:04:14.000000000 +0100
+++ views_alpha_pager.module 2007-02-18 23:32:18.000000000 +0100
@@ -138,13 +138,21 @@
}
$view->query = str_replace_first(" ORDER BY ", " ORDER BY $myfield, ", $view->query);
$view->countquery = str_replace_first(" ORDER BY ", " ORDER BY $myfield, ", $view->countquery);
-
+
// save the pager so we can add it to the top and bottom easily
$view->alpha_pager_output = theme("alpha_pager", $items, $apage);
}
function _views_alpha_pager_build_query($view) {
+
+ $views_path = drupal_get_path('module', 'views');
+ require_once("./$views_path/views_query.inc");
+ $info = _views_build_query($view);
+ $view->query = _views_replace_args($info['query'], $info['args']);
+ $view->countquery = _views_replace_args($info['countquery'], $info['args']);
+
$query = $view->query;
+ $countquery = $view->countquery;
// Run-time replacement so we can do cacheing
$replacements = module_invoke_all('views_query_substitutions', $view);
This patch resolved all issues on my test page (2 items per page, 1 sort criteria field = node title) and items are displayed perfectly, 2 by 2, also with numeric paging if needed (if there are more than 2 item per letter; by the way, it would be nice to set also a demonstration site thsi way, to show some pages also with numeric pagination, or?), but probably more testing wouldn't hurt before announcing it as a solution.
Comments
Comment #1
douggreen commentedThanks for the code! I need help confirming that it is needed. I was previously able to reproduce the problem in D4.7, but I'm not longer able to reproduce it in D5.
Please make sure that your version of views.module is at least 1.166.2.6 (which is what I have installed).
If your version of views is at or higher than this, then please provide the "export" code for you view so that I can import and test it on my system.
Comment #2
luti commentedI have exactly the same version of views module.
Export is:
Comment #3
douggreen commentedI was able to reproduce and fix the problem. Thanks!
Comment #4
(not verified) commented