[wp-trac] Re: [WordPress Trac] #7589: Fatal error: Call to a member function get_page_permastruct() on a non-object in /home/omry/dev/php/wp/2.6/wp-includes/link-template.php on line 152

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 4 21:23:42 GMT 2008


#7589: Fatal error: Call to a member function get_page_permastruct() on a non-
object in /home/omry/dev/php/wp/2.6/wp-includes/link-template.php on line
152
-------------------------------+--------------------------------------------
 Reporter:  omry               |        Owner:  anonymous
     Type:  defect             |       Status:  new      
 Priority:  normal             |    Milestone:  2.7      
Component:  General            |      Version:  2.6      
 Severity:  normal             |   Resolution:           
 Keywords:  reporter-feedback  |  
-------------------------------+--------------------------------------------
Comment (by jacobsantos):

 I talking about {{{$wp_rewrite}}} global being null, meaning that the
 function is being called before the global is created and set up to the
 {{{WP_Query}}} class. If it is working for a post and not a page, then
 that seems to be a separate and valid issue.

 As for the test cases, I might help you with those. You're going to need
 one for {{{WP_Rewrite::get_page_permastruct()}}} for both posts and pages.
 Several for {{{_get_page_link()}}}, which has the global set up. It would
 be better if they were unit tests, because you're going to have to destroy
 the global and set it up for each test. That is going to adversely affect
 the other test cases.

 The test suite is going to save the state of the {{{$wp_rewrite}}} before
 the test cases and then restore it after the test case.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7589#comment:11>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list