Merge pull request #32685 from woocommerce/fix/32028-settings-method-exists-fatal

Address possible type error during install on PHP 8.x
This commit is contained in:
Peter Fabian 2022-04-27 13:49:04 +02:00 committed by GitHub
commit 68234755d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix possible fatal error during install on PHP 8.x

View File

@ -702,7 +702,7 @@ class WC_Install {
$settings = WC_Admin_Settings::get_settings_pages();
foreach ( $settings as $section ) {
if ( ! method_exists( $section, 'get_settings' ) ) {
if ( ! is_a( $section, 'WC_Settings_Page' ) || ! method_exists( $section, 'get_settings' ) ) {
continue;
}
$subsections = array_unique( array_merge( array( '' ), array_keys( $section->get_sections() ) ) );