Bug in nextProject()?

Federico's Avatar

Federico

14 Apr, 2015 05:39 PM

Hello and thanks for the great work!

I think there could be a bug in the nextProject() function in cms/system/modules/projects/view.php:
first line of the function is "global $clerk, $project;".
If that function is called in the header of the page, projectTitle() returns nothing because I guess it loses its reference to the right project or something like that.
I changed that line to use just $clerk global, as it is in prevProject() function, and it seems to work ok (although I didn't do extensive testing yet). Could it be a proper solution or am I risking to break something else?

Thanks

  1. 1 Posted by Matthias on 05 Feb, 2019 10:18 PM

    Matthias's Avatar

    I know there is not much hope for a reply, but I thought I might try anyways:

    Not sure if this is related to the above, at least Federico's solution didn't solve my case:
    When using the standard nextProject link

    <a href="<?php echo nextProject(); ?>">Next Project</a>
    
    everything works fine.
    When using
    <?php $next_project= nextProject( true ); ?>
    <a href="<?php echo $next_project['link']; ?>"><?php echo $next_project['title']; ?></a>
    
    there will be no title returned on the last project of a section - so it does not loop back to the first one. The link works fine, but any other item of the array does not...

    Any guesses, anyone?

  2. 2 Posted by Matthias on 05 Feb, 2019 10:56 PM

    Matthias's Avatar

    Just to clarify:
    On the last project of a section, the array for next_project contains only one entry (link), as evidenced using var_dump($next_project).
    On any other project, the array contains all the values.

  3. Support Staff 3 Posted by Mikael on 11 Mar, 2019 06:17 PM

    Mikael's Avatar

    Good catch, thanks. I'll add this to the list of updates and fixes.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac