Opened 19 months ago
Closed 19 months ago
#58821 closed defect (bug) (fixed)
add_option() called using deprecated parameter in upgrade_630()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Changeset [55854] ensures that option can_compress_scripts
autoloads. The changeset includes the upgrade_630()
function that will record a new option value in the database to preserve what value may have been saved previously there. However, that function incorrectly invokes add_option()
using a deprecated parameter.
The upgrade_630()
function looks like this in revision 56176:
function upgrade_630() { global $wp_current_db_version; if ( $wp_current_db_version < 55853 ) { if ( ! is_multisite() ) { // Replace non-autoload option can_compress_scripts with autoload option, see #55270 $can_compress_scripts = get_option( 'can_compress_scripts', false ); if ( false !== $can_compress_scripts ) { delete_option( 'can_compress_scripts' ); add_option( 'can_compress_scripts', $can_compress_scripts, 'yes' ); } } } }
add_option()
is called using the third parameter, which is deprecated. The upgrade code will cause a deprecation warning to be thrown when executed and WordPress is in debug mode. The value will be preserved nevertheless.
Patch is attached to resolve this.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Nicely spotted @gudmdharalds!
The patch looks good to me.
Note to reviewers: While
'yes'
is the default value for the$autoload
parameter, and could therefore be removed here entirely, it was discussed in the original ticket and considered more explanatory to be explicit.I don't think this one needs testing. The issue is quite apparent. Adding for
commit
consideration.