Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: Pagination - Pagination for Default Language Shown Regardless of Current Language
Status | Resolved |
Add-on / Version | Publisher 1.6.1 |
Severity | Critical |
EE Version | 2.9.2 |
Nick Benson
Mar 03, 2015We’re encountering an issue where pagination generated by and are showing the page counts for the primary language, rather than the current language.
For example, on a simple category index page, there might be 30 entries in English (default language) but only 2 in French. Both the English and French indexes will show pagination as if there were 30 entries.
Thoughts, any?
Structure 3.3.14.7 is also being used, if that’s of any help in your diagnostic process - everything’s up to date, I believe.
BoldMinded (Brian)
Haven’t encountered this one yet, but I’ll be able to look into it early next week.
BoldMinded (Brian)
Can you be more specific? Are the pagination links correct and the total count is incorrect? Is the results tag inside of the entries tag? Are both tags showing incorrect counts or just low_search? Can you attach examples of template code you are using and screenshots of output?
Nick Benson
I attached an image, which I believe you can see.
Template is as follows:
In this case, there are ~1850 entries in English, 2 in French, and 0 in German. In all three languages, the “Last Page” link goes to …/P370.
In each case, the “last” link goes to …/P370/
BoldMinded (Brian)
Can you do me a favor and go into the models/publisher_entry.php file, around line 1240. You’ll see a conditional where it tries to modify the query for pagination… just add a var_dump in there somewhere to see if the $sql = str_replace() function is getting called or not.
BoldMinded (Brian)
It sounds like you have Entry Persistence on, in which case it will not try to alter the count b/c if you are viewing a secondary language, it will still show the entries from the default language. Try turning off that setting to see if the results are different.
BoldMinded (Brian)
I did some more testing last night and there is definitely something wrong with the pagination. I 99.9% sure this was working some time ago, so not sure what the issue is. I’ll dig into it more this weekend or early next week.
Nick Benson
Excellent, appreciate you taking a look.
We initially had persistence turned on, but, all three settings for it have been set to “No” for quite some time now (several months); not sure if that’s pertinent or not.
The pagination function in models/publisher_entry.php starts at line 1408 in the latest version of Publisher that’s on Devot:ee, if that’s noteworthy; in any event, it looks like it’s doing what it supposed to do, I think…
Modified with a pair of var_dumps:
French:
BoldMinded (Brian)
Fixed, new build emailed.
Nick Benson
Excellent!
In this instance, there are no results in German, but, it displays the pagination as if there were as many entries as the primary language (same behavior as before the bug fix, I think), output as is follows:
“Page 1 of 0 pages 1 2 3 > Letzte ยป”
I imagine I can work around this with a conditional, probably, but, still worth looking at at some point, I think, maybe?
Thanks again!
BoldMinded (Brian)
Nick, find line 1492 of models/publisher_entry.php and change it to <= 1 instead of == 1, e.g. https://www.dropbox.com/s/04o59z1sywh89lh/Screenshot 2015-03-09 22.16.07.png?dl=0
Nick Benson
Excellent! Resolved, insofar as I’m concerned, thank you!