I am attempting to use flippy with a custom content type in Drupal 7.0. When I choose "Build a pager for this content type" the pager does not show up on the content type pages. The following is in the HTML source for the page:

<ul class="flippy">
<li class="first">

<li class="previous">

<li class="next">

<li class="last">

</ul>

If I turn on the "Add semantic previous and next links to the document HEAD" option, the correct link DOES show up in the head of the document (e.g.
), but the ul in the body is still empty.

Finally, it throws an error about half the time on page load saying "Notice: Undefined variable: first_link in include()... Notice: Undefined variable: previous_link in include()... Notice: Undefined variable: next_link in include()... Notice: Undefined variable: last_link in include()". The error is thrown whether the second flippy option is selected or not.

An example of the error can be found at: http://joyna.noahfreitas.com/artworks/lampshade

Flippy was added after the content type and instances of the type were created, but I have run into the same problem with a new test content type as well.

CommentFileSizeAuthor
#3 flippy.patch560 byteslorinpda

Comments

wilgrace’s picture

I'm getting the same issue - same install as above.

On enabling the semantic links at the Content Type, I'm getting the following error message:

Notice: Undefined variable: first_link in include() (line 27 of E:\xampp\xampp\htdocs\massive7\sites\all\modules\flippy\flippy.tpl.php).
Notice: Undefined variable: previous_link in include() (line 28 of E:\xampp\xampp\htdocs\massive7\sites\all\modules\flippy\flippy.tpl.php).
Notice: Undefined variable: next_link in include() (line 29 of E:\xampp\xampp\htdocs\massive7\sites\all\modules\flippy\flippy.tpl.php).
Notice: Undefined variable: last_link in include() (line 30 of E:\xampp\xampp\htdocs\massive7\sites\all\modules\flippy\flippy.tpl.php).

the html list output is then empty - no text or links

wilgrace’s picture

Hi Eaton, is this module likely to be supported? It's a great bit of functionality, and currently the only module that handles it in R7, so it would be good to know if it's likely to be ready for more than a production environment

thanks

lorinpda’s picture

StatusFileSize
new560 bytes

Hi,
The function definition for function template_preprocess_flippy() simply needs the parameter to be passed by reference. In other words simply change:

function template_preprocess_flippy($vars)

to

function template_preprocess_flippy(&$vars)

I've attached a patch for you to review.
....
This is a really nice module. Are you still looking for a co-maintainer?
Hope that helps.
Lorin

wilgrace’s picture

Ah so simple - thanks very much lorindpa, it's working beautifully now

noah.freitas’s picture

Thank you, that worked beautifully.

PMorris’s picture

Perfect this is exactly what I was looking for. I couldn't figure out how to get a pager on a node rather than a page!

dodorama’s picture

I applied the patch and it works. Thanks.

scottlozier’s picture

Issue tags: +clarification

Thanks. Worked great.

I found the patch notes confusing - all you have to do is add & to line 165 before $vars

Line:165
-function template_preprocess_flippy($vars) {
+function template_preprocess_flippy(&$vars) {

btmash’s picture

Status: Active » Reviewed & tested by the community

I can verify the patch fixes the issue.

MGParisi’s picture

tested no issues

Please post when fixed:)

btmash’s picture

Status: Reviewed & tested by the community » Fixed

From what I saw, this has now been fixed.

Status: Fixed » Closed (fixed)
Issue tags: -clarification

Automatically closed -- issue fixed for 2 weeks with no activity.