Hello,
I am seeing a small issue, I installed flippy and activated it for a content type, but even though I am on the first node, I still see a previous link which gets me to the latest node, and viceversa.
Another thing I would need support is, I am trying to render the pager in a custom template.
page--blog.html.twig but I cannot seem to succed.
I read this but I dont understand how to implement it:
If you turn on Flippy for a content type, but hide the pager in the Manage
Display page, its links will still be available in the theme layer when it comes
time to output node.tpl.php. If you like, you can weave the pager links right
into the node manually in your own templates.
Thanks,
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | flippy-wrong_prevlink_on_last_page-3033924-5.patch | 690 bytes | sgalindo2388 |
| #4 | flippy-wrong_prevlink_on_last_page-3033924-4-should-fail.patch | 552 bytes | szeidler |
Comments
Comment #2
rliIt's likely that 'Loop through nodes' option has been checked that leads to the issue?
I think the variable is no longer available in twig, the description only applies to D7 unfortunately. I will update the description to make it clear.
Comment #3
rliComment #4
szeidler commentedI can confirm the problem, when being on the last page: it links to the first item. On the first page I don't see any issues.
Actually it is working, when I manually set the
Sort the pager by something other than ascending post datevalue to "Published on" and "ASC". This is strange, because should be the default behavior.With the attached patch you see the problem demonstrated using the new FlippyTest class. The current tests are a bit misleading. They are checking if we see the expected previous/next link texts, but they are not checking, if it's the actual correct links to the expected nodes.
In the attached patch you can see. If we're on the last page, i would expect the second node to be the one for the "previous" node. But it's showing the first one.
Edit: I see that there is something with `/subdirectory` in the test, but you see also the different node ids.
Comment #5
cameron prince commentedI noticed this problem happening, and sorting problems in general, after updating from beta1 to beta3. I tried going back to beta2 and it seemed to have the same problem. I ended up just locking the module to beta1 for now.
Comment #6
sgalindo2388 commentedAs cameronprince mentioned in #5, this problem doesnt happen in beta1, however now I get a PHP warning "Warning: count(): Parameter must be an array or an object that implements Countable in /web/modules/contrib/flippy/src/FlippyPager.php on line 335" I created this patch to fix the issue on beta1 branch but there's probably a better/actual permanent solution to the problem.
Comment #7
karlsheaJust a pointer with anyone having sorting issues: I did a diff between beta1 and beta4 to figure out what's going on, and it turns out it's this:
(FlippyPager around line 176)
We've got a ton of older nodes with a langcode of "und" in the database, then a bunch of new ones with "en", so half of them don't appear in the query results.
Comment #8
anybodyCould anyone here please confirm that the issue still exists with latest 8.x-1.x-dev and Loop through nodes option disabled?
Are you having "Show empty links" enabled?
Best would be if someone could write a test for this, which is failing until fixed...
Comment #9
anybodyEDIT: Sorry wrong issue!
Comment #10
anybodySorry wrong issue!
Comment #11
anybody@Grevil could you please check this one also?
Comment #12
grevil commentedOnly reproducible, when checking the "Loop through nodes" option. But that is the desired behaviour when checked.