Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Undefined index: id in Loader.php:1019 #5631

@BrianHenryIE

Description

@BrianHenryIE

Describe the bug

Our logs are full of lots of:

PHP Notice:  Undefined index: id in /path/to/wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Loader.php on line 1019
PHP Notice:  Undefined index: value in /path/to/wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Loader.php on line 1019

where Loader.php is preloading options.

I added in some extra logging:

error_log((new Exception())->getTraceAsString());

#0 /path/to/wp-includes/class-wp-hook.php(287): Automattic\WooCommerce\Admin\Loader::add_component_settings(Array)
#1 /path/to/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
#2 /path/to/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php(131): apply_filters('woocommerce_sha...', Array)
#3 /path/to/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php(222): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->initialize_core_data()
#4 /path/to/wp-includes/class-wp-hook.php(287): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('')
#5 /path/to/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#6 /path/to/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#7 /path/to/wp-admin/admin-footer.php(95): do_action('admin_print_foo...')
#8 /path/to/wp-admin/edit.php(464): require_once('/home/customer/...')
#9 {main}

error_log( $group );

general

error_log( json_encode( $group_settings) );

{
	"errors": {
		"rest_setting_setting_group_invalid": ["Invalid setting group."]
	},
	"error_data": {
		"rest_setting_setting_group_invalid": {
			"status": 404
		}
	}
}

To Reproduce

Refresh a page. Orders page is a sure one. Probably more.

Refresh the admin orders list page.

Expected behavior

Clean logs.

Environment:

WooCommerce 4.7.0
Siteground WordPress hosting.
PHP 7.3

Metadata

Metadata

Assignees

Labels

status: staleThe issue/PR is staletype: bugThe issue is a confirmed bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions