I have created a simple test node of type Page with a long content in the body field, and use Paging module to paginate it. Now, if I add the the path to that page which is the following:

content/test-setting-titles-pages-created-paging-module

to the Clean Pagination module settings, nothing happens. However, if I add the node equivalent path which is:

node/597/edit

to the Clean Pagination module settings, then as long as I access the node using this path, it works. But if I access using the earlier path, then clean pagination doesn't work. Does anyone know why, or the solution to this?

Thanks,
James

Comments

j_ten_man’s picture

I would love to hear people's thoughts on this but I'm pretty sure that it is not possible without some type of core hack.

The issue:
- drupal_bootstrap is called on page load
- One of the steps (DRUPAL_BOOTSTRAP_PATH) makes a call to drupal_init_path().
- During the last step, hook_init is called, after the above.

The problem is with the order of how things are being called. drupal_init_path takes the query parameter ('q') and looks up the source. You then have $_GET['q'] set to the source with $_REQUEST['q'] being the original path passed in. If you take the alias 'content/test-setting-titles-pages-created-paging-module' and add make it 'content/test-setting-titles-pages-created-paging-module/2' then drupal_init_path() does not find the page and thus you get a page not found. If there's a way to edit the parameter before drupal_init_path, then this would be possible.

Comments or thoughts?

Looking into this for D7 now.

j_ten_man’s picture

Title: How do you specify path to a page that includes a pager? » Clean pagination doesn't work on pages with a url alias
barteque’s picture

At the moment I'm testing modified version of the module.
I changed cleanpager_init() to cleanpager_boot() added require_once('includes/path.inc'); and in 'system' table switched module to be run in bootstrap. It works, by now.

j_ten_man’s picture

Version: 6.x-1.0-alpha2 » 7.x-1.x-dev
Status: Active » Needs review

Thanks @barteque. I've refactored how several of the functions work to work with your suggestion and aliased paths are now working. Please pull the latest dev version and test. I've only updated the D7 version. If someone wants to backport, then great, but I have no plans to.

j_ten_man’s picture

Status: Needs review » Fixed
j_ten_man’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Anonymous’s picture

Hello,

My issue is similiar but it deals with EVA (Entity Views Attachment) module.

I have clean pagination 7.x-1.0.
I have view on my node added by EVA.

Clean pagination doesn't work on my pages.
But it works when I use node equivalent like node/17.
Normal page view works perfect.

Could you provide integration with EVA module?

j_ten_man’s picture

This is in the latest dev release - or will be. I'll attach a patch below.

j_ten_man’s picture

Status: Fixed » Needs review
StatusFileSize
new762 bytes

Please test.

octapopa’s picture

The patch don't work for me. @barteque Please tell me how I can switched module to be run in bootstramp? Note: I am new in drupal.

j_ten_man’s picture

Are you using the latest dev version of the module?
What url value do you have in the settings page? If you are not using the latest dev version, you will need to make sure to have the aliased path.

octapopa’s picture

Yes, i used the last dev version of the module, and the path in the setings is node/*. It works, before run autopath. I forgot to call using Drupal 6.

j_ten_man’s picture

This is a D7 fix only. If someone wants to rework the D6 version, they can but otherwise it will not work in D6, only D7.

playfulwolf’s picture

Status: Needs review » Needs work

Tryed patch: it works only with "Use page/page_number " option selected

playfulwolf’s picture

by the way, I've tried with 7.x-1.0 version, NOT the dev, as dev seems to have this patch applied (the problem still persists)

j_ten_man’s picture

Please test the latest dev version and report back. I am unable to reproduce with the latest dev.

playfulwolf’s picture

this patch is done for 7.x-1.0 version - I can easily see that by seeing the code.
live example: http://naurio.lt , now it is with "Use page/page_number" unchecked, you can see results by browsing on the top menu.
when it is checked everything works as expected: with latest dev and on stable+patch (the same result)

j_ten_man’s picture

What do you have entered in to your settings for which pages to use the pager on?

j_ten_man’s picture

I was able to reproduce the error if I don't put <front> in the settings. Otherwise I can't reproduce so not sure (note that if I don't enter front, the page/page_number version doesn't work either so I'm not sure if this is why it's not working for you). Anyways, I'll be interested to see what your settings are.

playfulwolf’s picture

StatusFileSize
new11 KB

Printscreen of current settings. First is the front page view. I can repeat, that with those settings everything works fine just for the front page, but not on other ones:
http://naurio.lt/2 - for the front page
http://naurio.lt/papuosalas/ziedas?page=2 - for the others

playfulwolf’s picture

StatusFileSize
new11.68 KB

Here are the settings that work, I will leave them like this, you can see live site.
It is 7.x-dev version without any patches

playfulwolf’s picture

ouch, there is another problem - with the last settings with "Use page/page_number" checked front page view paging is not working at all, showing "page not found errors" on all exept front page
btw, I am using BOA 2.0.3 stable install on Nginx server

I am turning clean pagination module off, as this is major bug

j_ten_man’s picture

Put <front> in your settings box. This is required for the front page to work. It says it on the description of that settings box (not sure but you're admin settings don't show the description) and it's what I stated above. Let me know if that works.

playfulwolf’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

ok, I've put <front> and now everything works on the other pages only when "Use page/page_number" is checked

mthiner’s picture

Did someone rework this patch in D6? When I add the D7 patch above I get the pagination to appear right in the URL but none of my content shows up. Thanks.

j_ten_man’s picture

Status: Needs work » Postponed (maintainer needs more info)

No D6 rework that I know of.

I am unable to reproduce. I'm not sure if it's clashing with your theme or what, but content is showing up fine for me.

mthiner’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Alright, so here is my situation. The clean pagination doesn't work on some pages (those that have url alias) and so I add the D7 patch (even though I'm using D6). When I add the patch, the pagination works on the pages I select in the settings, but my content disappears. Either way it doesn't matter since any site that has pagination gives me a white screen when I go in to edit it. I have this function: function body_extra_class() {

$output = "";
// Grab the segment name from the URL. This method ensures that
// child pages also carry the class.
$args = explode('/', request_uri());
if ($args[1] == 'shows' && (!empty($args[2]))) {
$output = $args[2];
}

return $output;
}
Would that cause problems for pagination?
Thanks.

j_ten_man’s picture

I don't think that would cause it...but I can't say for sure. That's just adding a class to the body.

My_Maks’s picture

Version: 6.x-1.x-dev » 7.x-1.0
StatusFileSize
new169.9 KB

Good day. My situation is that clean pagination doesn't work correctly (with latest dev and on stable+patch (the same result)). You can see settings in attach file below. So, when I'm trying to go on second page at the end I'm still on the same page, but with 'sms/page/1' alias. Did you know where the problem is!

Thanks.

j_ten_man’s picture

Enter <front> into the settings. It doesn't look like you're on the latest dev because the instructions under the box should tell you that. Here's what the latest description on the settings page should say (Drupal 7):

Set which pages to apply clean pagination to. Put each page on a new line and use the source page path (do not use the url alias), without a leading slash. For example, enter "node/a" for node 1. For the front page, enter "<front>".

My_Maks’s picture

StatusFileSize
new109.28 KB
new85.05 KB
new102.49 KB

I undestand. I've done like you said. But, when I'm trying to go on second page it send me on 404 page.

It's Drupal 7. Page for clean pagination has system path - node/9 (alias - sms). Settings in attach file. Result the same. And It's a mistake wich you can see on picture.

Note: I'm a beginer in Drupal.
Thank you!

j_ten_man’s picture

Getting closer. Is this the front page? You need to enter <front> in the settings if so (like it says in the description).

My_Maks’s picture

No is not the front page.

j_ten_man’s picture

Could you pull the latest version and let me know if it works? I think it has to do with you being on a different language site. I pushed up a quick change, but I'm not 100% sure it will fix the problem.

My_Maks’s picture

StatusFileSize
new86.56 KB
new81.79 KB
new92.35 KB

Unfortunately the problem is still there. When I'm trying to go on second page at the end I'm still on the same page, but with 'sms/page/1' alias. You can see this on screens.

Thank you.

Angerslave’s picture

StatusFileSize
new2.02 KB

Just had a chance to port this patch to D6. Check this out.

jitendra verma’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)