I encounter several problems when using both modules together.

1. <!--paging_filter--> comment in each cell of the outputed HTML-table.
Playing with the order of the filters doesn't help. See http://drupal.org/node/259433 .

2. URL-Parameter 'page' is used by both modules resulting in unwanted paging behavior.

When I have a Paging <!--pagebreak--> in a content and a table manager table tag too e.g.

text
<!--pagebreak-->
text
[tablemanager:1,NULL,TRUE,NULL]

it effects the data of the table.

It would be great if the devs of these modules discuss together to solve this issue.

CommentFileSizeAuthor
#3 paging_issue.png59.52 KBpeterdd

Comments

pobster’s picture

This is completely irrelevant to Tablemanager as it doesn't *use* the URL parameter 'page', Drupal does. All Tablemanager does is to pass information to Drupals own inbuilt table producing api and as such isn't 'responsible' for how it works - the issue is between paging and Drupal itself, it has nothing at all to do with Tablemanager.

Pobster

peterdd’s picture

I don't know if it's a drupal core issue, I just stumbled over this.
Both generate the navigation links and both contain the same.

This is the content of the node body:

some text for the first page
some text for the first page
<!--pagebreak-->

[tablemanager:1,2,TRUE,NULL]

[tablemanager:1,3,TRUE,NULL]

test

produces nav urls like
http://domain/path?page=0%2C0
of all 3 paging navbars (2x tablemanager, 1x paging)

Curiously, if I reference another tablemanager table id it seems to work a bit more like it should (not full right):

some text for the first page
some text for the first page
<!--pagebreak-->

[tablemanager:2,2,TRUE,NULL]

[tablemanager:1,3,TRUE,NULL]

test

This tiny change now
produces nav urls like
http://domain/path?page=0%2C0
for the paging navbar AND for the second tablemanager table (id 1),
but 3 comma separated values for url parameter page:
http://domain/path?page=0%2C1%2C1

If I change the node body to this:

some text for the first page
some text for the first page
<!--pagebreak-->

[tablemanager:2,2,TRUE,NULL]

[tablemanager:2,3,TRUE,NULL]

test

it even looks better because the tablemanager table navbars have links with a 3 comma separated url page parameter, while the paging navbar has a 2 value(comma separated) url page parameter.

Attached is a picture that shows navigating through the first example.

peterdd’s picture

StatusFileSize
new59.52 KB

here is the pic:

peterdd’s picture

Priority: Critical » Normal
peterdd’s picture

pobster, in tablemanager.module function tablemanager_display() you are working with the 'page' parameter and global pager variables:

line 1035 and following:

  $page = isset($_GET['page']) ? $_GET['page'] : '';
  $pager_page_array = explode(',', $page);
  $from = ($pager_page_array[$tid] * $list_length);
 ...

$pager_page_array[$tid] ???
What happens if my table id is 1000?

pobster’s picture

That code is lifted directly from the table paging api - it's exactly the same, I just need to emulate it there because of the serialization (and that mysql can't automatically sort it) - again with the, "it's nothing to do with me"... It's Drupal core, I cannot change the way my module works else I'd have to write my own table and pagination apis and that's just pointless? It's hardly my fault that Drupal uses 'page' to paginate things!

http://api.drupal.org/api/function/pager_query/5

Now doesn't all that code look awfully familiar? All I'm doing is exactly the same thing so I can use Drupals api without actually using pager_query (as I mentioned, because I can't - the sql doesn't work). I gather the same information and pass it to Drupal so it does the work and I don't need to, hence all that's gathered is passed to theme('pager'... a Drupal api function. Your question regarding the pager_page_array being set is particularly random? I assume you don't realise that's simply setting an array in case you have more than one table present on any page, the pagination can be separate. Have you never noticed the URL containing 0,0,0,0,0,0,0...?

Pobster

pobster’s picture

Status: Active » Closed (won't fix)

I've just looked at the paging module on drupals cvs site - it does exactly the same thing as my module, collects shit, passes it to theme('pager'... Drupal does the work. There's your problem. Both modules are looking to the same thing for their input. There's no solution. At least tablemanager is doing something 'natural' it's how Drupal *does* things (i.e. tables with pagination), the paging module while being extremely useful, is creating something which Drupal is not able to do 'out-of-the-box', something ...un-Drupal?

Neither of us are (probably) willing to write our own paging api to fix this, it's pointless. These modules simply clash, you either use one or the other but not both. If you really want to use both then YOU'LL have to fix it, but neither of us will commit it as the change won't be a 'fix', it'll be a hack - nothing is broken, these modules are just incompatible. If you want instructions on how to change it, I'd recommend changing the paging module as it relies less on how theme('pager') works, it just requires simple paging - i.e. you're never going to have two pages displayed at the same time because well, you can't... But you can have multiple instances of tables... So, I'd take a look at function _paging_nodeapi and perhaps change it so it calls your own pagination functions which can be exactly the same as Drupals own, just using something other than 'page' for input.

Pobster

pobster’s picture

Status: Closed (won't fix) » Closed (fixed)