When using views alpha pager together with exposed filters in views, the pager gets destroyed and the results get unpredictable, at least when using table views.

Comments

nikoleta’s picture

The same happens when arguments are used with views. I'm using views in an organic group page, but when i use alpha pager instead of a numeric one, all nodes are displayed on the view (not only the group's ones).

douggreen’s picture

I checked in a patch last night that should fix arguments. If you can confirm this works for arguments, please let me know. (I actually did no testing in regards to the argument processing, but copied code I wrote for the taxonomy_views module, which is where I had recently ran into the same problem).

I haven't looked at the exposed filter problem at all. Is it at all related to the argument?

budda’s picture

I've got the exposed filter problem under 5.x

If i enter a value in to the exposed filter the results are narrowed down, and the alpha pager only displays letters to browse to matching nodes. This creates a path like /jargon?filter0=construction

The alpha pager seems to ignore the filter0 so clicking on another letter displays the filtered result, but then looses the filter argument (/jargon?apage=M) for any further browsing.

douggreen’s picture

I was able to reproduce and fix the problem with exposed filters. The links should now include the http query arguments. Please check-out the latest development release (1.5.2.13). Since this issue mentions both arguments and exposed filters, could you please test the current version against both these problems. I think that they are both working now. Thanks!

budda’s picture

Status: Active » Fixed

Passing the filter arguments around works great in the 5.x module. Could the same fix be bazck-ported to the 4.7 version to please?

douggreen’s picture

done - get the 4.7.x-dev version (views_alpha_pager.module 1.4.2.14)

dman’s picture

I've got the latest , DRUPAL-5--1-0 [1.5.1.18]
but am encountering errors with the filters also. Hidden in the first case, but also when exposed.

Alpha paging on node title, but wanting to filter on Node:Type (A CCK node) I get:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN ('')) ORDER BY left(trim(LEADING 'and ' FROM (trim(LEADING 'the ' FROM (trim' at line 1 query: SELECT DISTINCT left(trim(LEADING 'and ' FROM (trim(LEADING 'the ' FROM (trim(LEADING 'a ' FROM (trim(LEADING '\'' FROM (trim(LEADING '"' FROM (trim(LEADING ' ' FROM (upper(node.title))))))))))))), 1) FROM node node WHERE (. IN ('')) ORDER BY left(trim(LEADING 'and ' FROM (trim(LEADING 'the ' FROM (trim(LEADING 'a ' FROM (trim(LEADING '\'' FROM (trim(LEADING '"' FROM (trim(LEADING ' ' FROM (upper(node.title))))))))))))), 1) in /var/www/drupal_5/includes/database.mysql.inc on line 172.

That is to say:
... FROM node node WHERE (. IN ('')) ORDER BY ... looks to be wrong.

Works fine unfiltered.
Trying to enable another filter for 'Node:Published=Yes' makes it worse
WHERE (. IN ('')) AND (. '') ORDER
And just checking for Node:Published also fails

I'll have a look at the views_alpha_pager_views_query_alter and thereabouts I guess...

I got views.module 1.166.2.32 DRUPAL-5--1-6-BETA3 (apparently) via CVS as that was the last one actually tagged as DRUPAL-5 . I see other branches are also apparently available, I'll see if another branch solves the problem. Could just be compatability.
... investigating

douggreen’s picture

Make sure if you're using a views filter that has options that it works fine without views_alpha_pager first. t sounds like a view definition problem... the IN() part that is.

If you are using the latest views beta you should get the views_alpha_pager dev release. I'm waiting for views 5.x-1.6 to emerge from Beta before cutting a new tag.

Lastly, if you still have problems, please open a new issue, as this one has already been closed.

dman’s picture

Apologies, it appears I had a corrupted version of views that wasn't behaving even without alpha pager. Ignore me.

Anonymous’s picture

Status: Fixed » Closed (fixed)