WordPress.org

Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 5 years ago

#300 closed defect (bug) (fixed)

Blank settings when using ?showoptions=all get changed to "0"

Reported by: MC_incubus Owned by: matt
Milestone: Priority: normal
Severity: minor Version:
Component: Administration Keywords:
Focuses: Cc:

Description

When viewing the /wp-admin/options.php?showoptions=all "secret" page for changing some of Wordpress' hidden values, certain values will change to 0 if you submit them blank. For instance, if you have your Category Base blank, it'll get set to zero. Also, if you have your blogfilename setting blank, it'll be set to zero. This obviously breaks a lot of your permalinks.

Attachments (1)

0000300-options.php.diff (2.4 KB) - added by MC_incubus 16 years ago.

Download all attachments as: .zip

Change History (10)

#2 @MC_incubus
17 years ago

This appears to be due to a CVS database change that didn't make it into upgrade.php basically, everything got an option type of 1, so those with option type of 3 (for string) didn't get set to "" instead of "0" when submitted blank. The database is converted fine when upgrading from 1.2 Mingus, so there's not really a problem. Just, people who use an earlier CVS version should probably do a clean install when they upgrade to 1.3 final.

#3 @MC_incubus
17 years ago

Okay, apparently option_type has been depreciated, so they are all supposed to be 1... but unfortunately some code in options.php still requires that they be set. I'm going to take a look at that code and try to get it working.

#4 @MC_incubus
17 years ago

I went back to 1.2's options table and made an array out of all values with option_type of 3 (text values that should NOT be set to "0" if blank, but instead set to "" (blank!)

I removed the option_type check code that shouldn't still be there, and replaced it with a check of the array of "text" options.

I've tested, and it seems to work as it should.

This seems to fix it for the all options pages including the "secret" /wp-admin/options.php?showoptions=all

#5 @MC_incubus
17 years ago

This still appears to be a problem... and running upgrade.php doesn't sort out the issues in the database.

#6 @Kitten
17 years ago

The new update schema sets "option_type int(11) NOT NULL default '1'" to all options. These lines from options.php cause the problem:
if (!$new_val) {

if (3 == $option->option_type)

$new_val = ;

else

$new_val = 0;

}

Since all options are type 1 now, all blank options are set to 0. Not ideal, as you have noticed. The devs will have to discuss what to do, maybe the option types need to be set properly?

#7 @Kitten
17 years ago

Reminder sent to rboren

Check out my note above (0000962), this could nuke some "power user's" blog if the wrong fields are left blank.

#8 @matt
17 years ago

  • fixed_in_version set to 1.5
  • Owner changed from anonymous to matt
  • Resolution changed from 10 to 20
  • Status changed from new to closed

This ticket was mentioned in Slack in #core-editor by joen. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.