Skip to content

PHP Warning: Undefined array key "new" in v8.0.1 #793

Open
@brnbs

Description

Describe the bug

After updating to WC Subscriptions 7.2.1 (Core 8.0.1) the following error message appears in the server log multiple times:
[php:warn] [pid 45:tid 45] [client 127.0.0.1:36334] PHP Warning: Undefined array key "new" in /var/www/web/app/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-object-data-cache-manager-many-to-one.php on line 36

$this->trigger_update_cache_hook( $change['type'], $object->get_id(), $key, $change['new'], $previous_value );

To Reproduce

I just updated the plugin from 6.7.0 and enabled HPOS on the store. Not sure if the HPOS change is relevant.

Expected behavior

No warning message in the logs.

Actual behavior

I don't see any change in the actual behavior, but it might affect performance due to caching.

Product impact

  • Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref

Additional context

The log contains the requester IP address: [client 127.0.0.1:36334]. Therefore, I believe this warning occurs during a cron execution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    good first issueThe issue is a good candidate for the first community contribution/for a newcomer to the team.priority: lowThe issue/PR is low priority—not many people are affected or there’s a workaround, etc.type: 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