Skip to content

Improve error handling: Cannot use object of type stdClass as array #567

Closed

Description

@jamesozzie

Bug Description

One user in the support forums reported the below error:

Uncaught Error: Cannot use object of type stdClass as array in /wp-content/plugins/performance-lab/modules/images/webp-uploads/rest-api.php:21 Stack trace:

#0 /wp-includes/class-wp-hook.php(307): webp_uploads_update_rest_attachment() 
#1 /wp-includes/plugin.php(191): WP_Hook->apply_filters() 
#2 /wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php(843): apply_filters() 
#3 /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(377): WP_REST_Attachments_Controller->prepare_item_for_response() 
#4 /wp-includes/rest-api/class-wp-rest-server.php(1143): WP_REST_Posts_Controller->get_items() 
#5 /mnt/data/home/502433.cloudw

Awaiting feedback from impacted user. No further details at present.

Screenshots

Additional Context

  • PHP Version:
  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]
  • Plugin Version: [e.g. 22]
  • Device: [e.g. iPhone6]

Activity

  1. added this to the 1.7.0 milestone on Oct 24, 2022
  2. mxbclang commented on Oct 24, 2022

    @mxbclang
    Contributor

    @mukeshpanchal27 Assigning this bug to you to take a look at when you return from PTO next week, thank you!

  3. removed
    Needs DevAnything that requires development (e.g. a pull request)
    on Oct 28, 2022
  4. added 2 commits that reference this issue on Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions