Needs work
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Page Manager
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Feb 2015 at 11:16 UTC
Updated:
21 Mar 2017 at 08:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
slowflyer commentedComment #2
slowflyer commentedComment #3
swigle commented+1 subscribing. Have exact the same issue.
Comment #4
aChris07 commentedSubscribed. Same issue here, just as reported.
I've temporarily sidestepped the issue by implementing a custom pager for comments, but it's definitely not a fix.
Comment #5
marpic commentedSame issue here. aChris07 could you please share your workaround, it could be useful for me too.
Thanks
Comment #6
aChris07 commented@marpic Sorry, hadn't seen your reply.
I basically replicated the core logic, except I don't extend the integrated pager method in the query, but rather call all the comments of a thread and then page it myself. It might probably be not very efficient on very large threads, but it's been working fine for me so far, considering patching the issue might take more time than I have.
Any suggestion or update on the topic would be most welcome.
Comment #7
scottalan commentedI know why it's not working and have a fix but not sure it's the "right" one. It would require a patch the core comment module. I'm wondering if there is a way to do this without a patch...?
I'll explain my findings in brevity:
When comments are being loaded there is a call to
comment_get_thread()and when comments are added to a page manager page that function is called again. This is basically where it all stems from.http://cgit.drupalcode.org/drupal/tree/modules/comment/comment.module?h=...
Now if we go to
includes/pager.inctheexecutemethod calls$this->ensureElement()http://cgit.drupalcode.org/drupal/tree/includes/pager.inc?h=7.x#n59
If you look at that method: http://cgit.drupalcode.org/drupal/tree/includes/pager.inc?h=7.x#n90
You will see that it increments
$this->elementwith thestatic $maxElementThe first time this runs
$this->element == 0, The next time it's ran$this->element == 1.My guess is, it thinks this is a different pager. Therefore, it thinks it's still on the first page.
Comment #8
scottalan commentedThis patch will fix the comment pager when adding comments via
node_context/node_commentsandnode_context/node_comment_wrapperand you don't have to hack the comment wrapper :).But...This also requires a patch to the core comment.module as well @see https://www.drupal.org/node/2472611
Comment #9
scottalan commentedComment #10
mpaler commentedHi,
Was having the same exact issues with my installation. Ctools/Panels managed node pages with lots of comments, comment pager funky...even started my own core bug report. Anyhow, sadly, I applied the patch in #8 and the core patch and i was still seeing the issue. Not sure what else to report. Will help if I can.
Mike
Comment #11
paulihuhtiniemi commentedI have been troubleshooting this issue. In version 1.6-rc1 things still work, but 1.6 and 1.7 are broken.
comment_form() function is run twice and thus comment form has ID "comment-form--2" and page has two pagers ($pager_page_array). Then again, only one comment element is actually rendered on page, but behind the scenes comments seem to get processed twice.
Comment #12
paulihuhtiniemi commentedFor me it looks like this commit introduced the problem: http://cgit.drupalcode.org/ctools/commit/?id=05d7202ef562b90fa1cf8c541ac... "Issue #1760384 by DamienMcKenna, meba: Update node_view.inc to execute the normal Drupal hooks"
Comment #13
paulihuhtiniemi commentedComment #14
paulihuhtiniemi commentedPatch from #2422123: should entity view hooks be triggered unconditionally in node_view, term_view and user_view pages? fixed this issue for me. Please test if it works for you too. If it does, we can close this issue as duplicate.
Comment #15
mpaler commentedPatch referenced in #14 fixed my issue. Thanks!
Comment #16
mpotter commentedI think the patch in #14 fixed it for the "comments" widget. But I'm still having trouble with the comment_wrapper widget not showing a pager at all. Might be just my dev system so curious if other people are seeing this.
Comment #17
rjacobs commentedAlso, if anyone formally reviews any patches from #2422123: should entity view hooks be triggered unconditionally in node_view, term_view and user_view pages? as part of this issue, please be sure to post your findings in #2422123 as well. I think the solution pending there is solid but there has not been a lot of authoritative feedback on the technical specifics of the proposed solution/patch. Any help moving that issue forward is much appreciated.
Comment #18
func0der commentedWell I find the real problem in being the page manager calling everything twice.
Also I got a little plot twist for you: I have the same issue, but it is only happening if I am logged in and I almost all times have only two pages showing up, but both with the same comment content.
Does that change anything maybe? Or do you not even have that problem?
Comment #19
func0der commentedThis would also fix the whole problem. It does not require a core fork or patch and the only down-side to it is, that the "page" parameter looks presumingly like this "1,1", "1,2" etc.
Take a look please. Not ideal, but at least core-fork-less.
Comment #20
func0der commentedSorry, guys. Wrong paths.
Edit: Okay, wrong paths again. Please apply with `patch -p2`
Comment #21
khoomy commented@func0der great, it works for me. But pager query string is encoded as ...?page=2%2C0%2C1, when I try to change manually in URL as ?page=2 then it does not work and shows only first page.
Comment #22
func0der commented@khoomy
If you would url decode the url you would see that "%2C" would decode to a ",".
I mentioned in #19 that that is a side effect of this whole process. Pagers are not working like "page=2" anymore, but for example like "page=1,2" or in your case "page=2,0,1".
I do not know why you have only 3 numbers, I guess one of your pagers is broken.
The first integer identifies the pager index and the second one the page of that pager.
Your pagers may look a bit odd, but at least they work without a fork ;)
Comment #23
Andrew Edwards commentedNot sure why, but #20 didn't apply for me against the latest dev. Here's a new patch.
Comment #24
func0der commentedYeah, sorry. I accidentally left "ctools" in the path.
@Andrew Edwards: Please provide interdiffs if you change existing patches. It is easier to follow the changes you have made and apply just those changes to the working copy.
Comment #25
socialnicheguru commentedComment #27
plopescPatch #23 works for me.
Thanks!
Comment #28
func0der commented@Plopesc
My patch is NOT!!! intended to be a solution for the problem.
It is just a WORKAROUND until someone finds a real solution to this problem.
I do not now think, that this should go in the the real module, but if that is what you want, so it be.
At least the pagers work somehow then.
Comment #29
func0der commentedComment #30
japerryMarking needs work per #20 and #28. The patch doesn't seem right in a general sense. But if it fixes some people's local issues, thats great. It'll need more eyes and a revised patch before going in.
Comment #31
webpavilion commentedWORKAROUND from #23 for node_comments and node_comment_wrapper
Comment #32
zkrebs commentedfor what it's worth, i applied to the current ctools stable d7 release;
It resolved the issue with my pager