Opened 16 years ago
Closed 16 years ago
#13830 closed defect (bug) (fixed)
Front page displays: Fix same static page warning
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Administration | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Front page display-> static page; if you choose same page for both Front page and Posts page a warning message will appear.
But if you choose static page without selecting a page for Front page, Posts Page and use the default "--Select--" for both, no warning message displayed. This will cause error, since the value for page_on_front will 0 but page_for_posts is set with no value. Warning message should be displayed.
Adding option_none_value=0 to wp_dropdown_pages will solve the issue.
Attachments (2)
Change History (8)
#1
@
16 years ago
Perhaps should include these in wp-admin/includes/schema.php too:
// 3.0 'page_for_posts' => 0, 'page_on_front' => 0,
#2
@
16 years ago
- Keywords commit added
Attached diff takes zeo's patch a bit further.
The reason why no warning showed up in the admin was because only one was getting sanitized as an integer. Since we're now going to use show_option_none => 0, sanitizing it won't help any, but since I caught it, we might as well also sanitize it (a review we need to do in a future release more thoroughly).
I also added a little code to catch bad values and fix them when showing options-reading (thus after saving). It does it silently, but I think that is perfectly acceptable for now.
#3
@
16 years ago
Of note, the code to fix the bad show_on_front value (bad when both of the options are 0) is required to fix the notice.
Fix warning for same page static page