Recent Topics

How to find source for fatal error?

Started by on Feb 09, 2005 – Contents updated: Feb 09, 2005

Feb 09, 2005 00:02    

I posted this problem in BUGS and THOUGHT I had it solved, but it doesn't appear that way.

Problem: If click arcdirurl ("more..." link under Archives), we get a fatal error:

Fatal error: Call to a member function on a non-object /.../b2evocore/_functions_bposts.php on line 1048

We're using the next/previous_posts_link (instead of the posts_nav_link). IF we switch back to nav_posts_link, the problem disappears & all is hunky dory. Line 1048, it turns out is this:

if (!$max_page)        $max_page = $MainList->get_max_paged();  

in the function definition for next_posts_link().

Hmmm. Why would posts_nav_link work & not next_posts_link? I looked at posts_nav_link & it looks like it sets a parameter called "max_paged" ... which doesn't EXIST in "next_posts_link" (it's called max_page, instead) and then just calls "next_post_link" to do the actual work. I thought MAYBE it was spelled incorrectly in "next_posts_link", so I changed it to PAGED and THOUGHT every thing was OKAY, but turns out NOT.

Any ideas what's going on here or how to track down the problem?

Here's the code from _main.php in that area.

<h3><?php echo T_('Journal Archives') ?></h3> 

<div id="navLink"> 
   <div id="newer"> <?php previous_posts_link('<newer posts'); ?>     </div> 
   <div id="bar">|</div> 
   <div id="older"> <?php next_posts_link('older posts>'); ?> </div> 
</div> 

<ul> 
<?php require( dirname(__FILE__).'/_archives.php' ); // ARCHIVES LIST INCLUDED HERE ?> 

<li> <a href="<?php $Blog->disp( 'arcdirurl', 'raw' ) ?>" title="See the complete archives"> <?php echo T_('more...') ?> </a> </li> 
</ul>

I'm not seeing anything in the code that appears to be causing a problem AND (until I coded up my own function as a work-a-round) hadn't modified the _functions_bposts.php file, so I was thinking BUG.

BTW - My work-a-round function just swipes the posts_nav_link function, stripping it of everything except the 'next_post' portion & using it in place of "next_posts_link"

Thanks.

Feb 09, 2005 02:23

line 1048... thats where the error is...

Feb 09, 2005 18:02

I know that. Line 1048 of _functions_bposts.php, which is a b2evo functions file that is a system file that I have not edited.

So what's wrong with line 1048?

if (!$max_page)        $max_page = $MainList->get_max_paged(); 

I thought it might be a typo, so I changed "max-page" to "max-paged". No go.

Any ideas? Missing a global variable?


Form is loading...

CCMS – This forum is powered by b2evolution CMS, a complete engine for your website.