#7602 closed defect (bug) (worksforme)
PHP Fatal Error when static front & posts pages are set the same
Reported by: |
|
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)
#2
@
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.
Can anyone else confirm this? I just tested this in 2.6.1 and I do not receive any fatal errors.