Why paging shows: 1 | 2 | 3 ... prev | next

hectorplus - November 13, 2006 - 05:22
Project:Playlist (toolkit, modules)
Version:4.7.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:hectorplus
Status:active
Description

...yet, there's only 5 files!

The paging at the bottom of the playlist shows there are more files, however, there arent more audio files!
Any dieas, help or fix? Thanks in advance.

#1

zirafa - November 14, 2006 - 18:51

This happens when trying to sort by "name" and also by "time". It shouldn't happen with other sort methods.
I've known about it for awhile but haven't had a chance to debug. Check out the function in audio_playlist.module, audio_playlist_browser().

#2

hectorplus - November 16, 2006 - 20:41

Thanks for the explanation. I can live with it.

#3

vph - November 26, 2006 - 20:06

I too have had this problem, but don't know how to fix it.

#4

mitke - December 15, 2006 - 09:17

If you noticed, this bug only occurs when the sort is by 'playtime' or without sort.
This is caused because pager_query tries to count the number of rows returned by the SQL query by replacing the "SELECT... FROM..." with "SELECT COUNT(*) FROM...". This works fine for simple queries, but not for complex ones. With these kind of queries you need to pass pager_query a parameter called $query_count with the SQL query to count the returned rows.

I have attached a text file with the function audio_playlist_browse in audio_playlist.module after the modifications (look for the $qry_cnt variable).

AttachmentSize
query_count.txt 6.3 KB
 
 

Drupal is a registered trademark of Dries Buytaert.