Make WordPress Core

Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#7602 closed defect (bug) (worksforme)

PHP Fatal Error when static front & posts pages are set the same

Reported by: thejusme's profile thejusme Owned by:
Milestone: Priority: normal
Severity: major Version: 2.6.1
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

When I set the "Front Page Displays" to be static and the same for both front page and posts, I experience a fatal PHP error when going to my Wordpress homepage. The error is on like 1619 in wp-includes/query.php:

$this->queried_object = & get_page(get_option('page_for_posts'));

It appears this is due to the nested function call on that line, although I'm not yet sure specifically why this error only occurs when both the front page and posts values are set the same. If the code above is replaced with the following code it appears to resolve the error:

$temp = get_option('page_for_posts');
$temp2 = get_page($temp);
$this->queried_object = & $temp2;

The reference operator actually appears to be useless because if removed from my fixed code block everything seems to function well also.

Change History (4)

#1 @sivel
17 years ago

Can anyone else confirm this? I just tested this in 2.6.1 and I do not receive any fatal errors.

#2 @mrmist
17 years ago

Me neither. No error. If both are set the same I get a warning in the admin panel, then the posts view just shows latest posts rather than static. (Though, strangely, with the static's name in the title bar.) So probably still broken behaviour.

#3 @DD32
16 years ago

  • Keywords reporter-feedback added
  • Resolution set to worksforme
  • Status changed from new to closed

Seems to work for me under 2.7, I'm closing as worksforme. If the reporter can reproduce it under a default theme, feel free to re-open with more details.

#4 @thee17
16 years ago

  • Milestone 2.7 deleted
Note: See TracTickets for help on using tickets.