[wp-trac] [WordPress Trac] #9105: with empty 'show_on_front' option is_front_page always show false
WordPress Trac
wp-trac at lists.automattic.com
Fri Jan 15 20:13:58 UTC 2010
#9105: with empty 'show_on_front' option is_front_page always show false
-------------------------------------+--------------------------------------
Reporter: kookoooo | Owner: anonymous
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 2.8.6
Severity: normal | Resolution:
Keywords: is_front_page has-patch |
-------------------------------------+--------------------------------------
Changes (by danaronson):
* status: closed => reopened
* version: 2.7 => 2.8.6
* resolution: invalid =>
Comment:
turns out this bug DOES exist (fix included). There is some conditional
code that sets option values in options-reading.php. In a VERY standard
case there is no else clause which sets them to the default values so
later on options.php sets them to null.
I fixed it one way, but perhaps the better and more global fix is
options.php to ONLY update the option is the value was set in the form (I
didn't want to do that fix, because I don't know what it would break).
The way to duplicate this bug is to go to the options reading panel if
there are no pages, update the option and voila, show_on_front gets
cleared...
Here's the diff of the fix:
{{{
*** options-reading.php Fri Jan 15 12:02:03 2010
--- options-reading.php.save Fri Jan 15 11:44:00 2010
***************
*** 53,63 ****
<?php endif; ?>
</fieldset></td>
</tr>
- <?php else: ?>
-
- <input type="hidden" name="show_on_front" value="<?php echo
get_option("show_on_front") ?>">
- <input type="hidden" name="page_on_front" value="<?php echo
get_option("page_on_front") ?>">
- <input type="hidden" name="page_for_posts" value="<?php echo
get_option("page_for_posts") ?>">
<?php endif; ?>
<tr valign="top">
<th scope="row"><label for="posts_per_page"><?php _e('Blog pages show at
most') ?></label></th>
--- 53,58 ----
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9105#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list