Posted by iwankgb on June 26, 2007 at 11:00am
2 followers
| Project: | Page Array |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Original code of pagearray.module does not work properly when more then one variable ($_GET['q']) is passed to the script (eg. pagination).
This imperfect patch should solve the problem :]
| Attachment | Size |
|---|---|
| pagearray.patch | 905 bytes |
Comments
#1
One commented line too far ;)
This patch should be ok.
#2
Thanks for the patch.
So far I've been using pagearray on pages where the original $_GET variables should be intact and not need resetting. E.g., URL is
?q=dynamicload/node&page=1
We send node to Page Array, so $_GET['q'] is reset, but the $_GET['page'] value remains. (Or alternately, I suppose, if we need to set other $_GET variables before calling pagearray, we can.)
Am I mistaken? Is this not currently working?
I'm using pagearray in two modules, dynamicload and printable. Is the issue in one of those modules? (If so, probably we should move this issue there.)
Or, if the issue is elsewhere, can you describe the use case and give some sample code?
#3
No, I was not using dynamic load.
I just wanted to retrive some HTML via AJAX ;) And I needed pagination to avoid rewriteing some code :]
#4
OK, third version of patch - I'm starting feeling sorry for the mess ;)
I use clean urls for AJAX as well - this is probably why this patch was neccesary for me :]
#5
Pagearray is designed to accept a Drupal path as an argument, not a string with GET information mixed in. The patch as it stands looks like it will break both path aliases and sites without clean urls. It seems messy to me to be parsing out get variables from a string. I'd prefer to find ways to do this outside of Pagearray.
(For future reference, the question of who submitted a patch goes into CVS commit logs rather than inline code comments, and generally you would just delete code rather than leave it commented out.)
I think you need to ensure the GET variables are set before calling Pagearray. Have a look at how this is done in
dynamicload_js()in dynamicload.module (part of Javascript Tools), You may be able to use dynamicload as a dependency.Specifically, you can make links dynamically load by adding a 'dynamicload' class to them. See the dynamicload README. Requires HEAD versions of jstools and pagearray.