Posted by jdanthinne on November 3, 2011 at 2:43pm
Status:
active
» needs review
Hi,
I needed it too, so I've done a first port to D7, using Coder Upgrade and then fine-tuned it myself.
Using it on my own blog, and it's working fine, BUT I don't use the Views function, so this part needs to be checked.
Great. So how does this compare with what's in Git for D6? Also, can we get a patch of this so it is easier to see the changes? Great that it's been run through Coder. Thanks @alexku & @jdanthinne
After fixing few coder module warnings I have created attached two patches. One is for initial d7 port from @jdanthinne and one is for prev_next_views
There are some warnings for prev_next module on using variables in db_query() query parameter.
Some of them (which use $search_criteria variable) are quite dangerous and can allow a user with 'access administration pages' permission to perform an SQL injection
Ok, so tested both patches against 6.x-1.x branch using vanilla D7 install.
Patch prev-next-drupal7-port-1231996-5.patch applies cleanly and prev_next navigation block works smoothly as expected.
Patch patch prev-next-views-drupal7-port-1231996-8.patch, which applies cleanly (though received warning about whitespace - it is right after function prev_next_menu() closing bracket) using latest views (and ctools) module with different node (nodes was generated by devel_generate) sort order's (Post date, Node ID, Image ALT) to see if everything is fine on different scenarios. And haven't seen any bugs.
Changing status to RTBC, though would be great if more testers could walk through same routine and test these patches. Thanks!
I followed the procedure in #13 and the main module seems to be working fine, though I haven't thoroughly tested. I didn't try out the views module (actually not sure what it's supposed to do - just add a field?).
Comments
#1
subscribe
#2
subscribe
unless is there a better way or another existing module in D7 for prev/next links?
#3
subscribe
#4
subscribe
#5
Hi,
I needed it too, so I've done a first port to D7, using Coder Upgrade and then fine-tuned it myself.
Using it on my own blog, and it's working fine, BUT I don't use the Views function, so this part needs to be checked.
#6
Looking good so far. It seems to work. The only thing I found is that the default text on the prev/next links is incorrect.
This is the default:
prev: [node:title] »next: « [node:title]
Where it should be:
prev: « [node:title]next: [node:title] »
#7
I haven't changed those values, they're the same as the D6 version.
So for those who want to upgrade, it wouldn't be good to invert that I think…
#8
Attached is a version of jdanthinne's port in comment #5 with fixed prev_next_views.
What was fixed:
#9
Great. So how does this compare with what's in Git for D6? Also, can we get a patch of this so it is easier to see the changes? Great that it's been run through Coder. Thanks @alexku & @jdanthinne
#10
I have just run coders code review and still see some critical warnings. Will fix them in prev_next_views part and re-upload soon
#11
Thanks!
#12
After fixing few coder module warnings I have created attached two patches. One is for initial d7 port from @jdanthinne and one is for prev_next_views
There are some warnings for prev_next module on using variables in db_query() query parameter.
Some of them (which use $search_criteria variable) are quite dangerous and can allow a user with 'access administration pages' permission to perform an SQL injection
#13
Ok, so tested both patches against 6.x-1.x branch using vanilla D7 install.
Patch prev-next-drupal7-port-1231996-5.patch applies cleanly and prev_next navigation block works smoothly as expected.
Patch patch prev-next-views-drupal7-port-1231996-8.patch, which applies cleanly (though received warning about whitespace - it is right after function prev_next_menu() closing bracket) using latest views (and ctools) module with different node (nodes was generated by devel_generate) sort order's (Post date, Node ID, Image ALT) to see if everything is fine on different scenarios. And haven't seen any bugs.
Changing status to RTBC, though would be great if more testers could walk through same routine and test these patches. Thanks!
#14
I followed the procedure in #13 and the main module seems to be working fine, though I haven't thoroughly tested. I didn't try out the views module (actually not sure what it's supposed to do - just add a field?).
#15
Views part saves view query result in a session and uses it for paging later. So you can use filters/arguments/ordering for paging