Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to use WP_Error object as an array #9

Closed
stevegrunwell opened this issue Aug 29, 2016 · 1 comment
Closed

Attempting to use WP_Error object as an array #9

stevegrunwell opened this issue Aug 29, 2016 · 1 comment
Assignees
Labels
type:bug Something isn’t working.
Milestone

Comments

@stevegrunwell
Copy link
Contributor

On WordPress 4.6.0, running the latest version of the feature/azure-plugin-rewrite-v4 branch, I'm getting the following error when trying to upload from wp-admin/media-new.php:

[29-Aug-2016 19:52:31 UTC] PHP Fatal error:  Cannot use object of type WP_Error as array in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-helper.php on line 413

Full error_log for the request, including artificial stack-trace added just before the return in Windows_Azure_Helper::get_unique_blob_name():

[29-Aug-2016 19:52:30 UTC] PHP Notice:  add_utility_page is <strong>deprecated</strong> since version 4.5.0! Use add_menu_page() instead. in /srv/www/{CLIENT}/htdocs/wp-includes/functions.php on line 3706
[29-Aug-2016 19:52:30 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1167
[29-Aug-2016 19:52:30 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1167
[29-Aug-2016 19:52:31 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1167
[29-Aug-2016 19:52:31 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1167
[29-Aug-2016 19:52:31 UTC] Array
(
    [0] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-helper.php
            [line] => 411
            [function] => sanitize_blobs_names
            [class] => Windows_Azure_Rest_Api_Client
            [object] => Windows_Azure_Rest_Api_Client Object
                (
                    [_account_name:protected] => 10updeveloper
                    [_access_key:protected] => +mtM8I7dqygfRtXJNjkZIFmB1oPNwTjYnkrmDrHwUDIEHFJiQv+hgt9s/olQRH5YWJB74pnC1ux1Lq872u8lyw==
                    [_current_url:protected] => 
                    [_signature_headers:protected] => Array
                        (
                            [0] => Content-Encoding
                            [1] => Content-Language
                            [2] => Content-Length
                            [3] => Content-MD5
                            [4] => Content-Type
                            [5] => Date
                            [6] => If-Modified-Since
                            [7] => If-Match
                            [8] => If-None-Match
                            [9] => If-Unmodified-Since
                            [10] => Range
                        )

                )

            [type] => ->
            [args] => Array
                (
                    [0] => ncmedia
                    [1] => Array
                        (
                            [2016/08/Screen Shot 2016-08-29 at 11.58.46 AM.png] => Array
                                (
                                    [2016/08/Screen Shot 2016-08-29 at 11.58.46 AM.png] => 2016/08/Screen Shot 2016-08-29 at 11.58.46 AM.png
                                )

                        )

                )

        )

    [1] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/windows-azure-storage.php
            [line] => 521
            [function] => get_unique_blob_name
            [class] => Windows_Azure_Helper
            [type] => ::
            [args] => Array
                (
                    [0] => ncmedia
                    [1] => 2016/08/Screen Shot 2016-08-29 at 11.58.46 AM.png
                )

        )

    [2] => Array
        (
            [function] => windows_azure_storage_wp_handle_upload_prefilter
            [args] => Array
                (
                    [0] => Array
                        (
                            [name] => Screen Shot 2016-08-29 at 11.58.46 AM.png
                            [type] => image/png
                            [tmp_name] => /tmp/phpOATbcM
                            [error] => 0
                            [size] => 87232
                        )

                )

        )

    [3] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-includes/plugin.php
            [line] => 235
            [function] => call_user_func_array
            [args] => Array
                (
                    [0] => windows_azure_storage_wp_handle_upload_prefilter
                    [1] => Array
                        (
                            [0] => Array
                                (
                                    [name] => Screen Shot 2016-08-29 at 11.58.46 AM.png
                                    [type] => image/png
                                    [tmp_name] => /tmp/phpOATbcM
                                    [error] => 0
                                    [size] => 87232
                                )

                        )

                )

        )

    [4] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-admin/includes/file.php
            [line] => 263
            [function] => apply_filters
            [args] => Array
                (
                    [0] => wp_handle_upload_prefilter
                    [1] => Array
                        (
                            [name] => Screen Shot 2016-08-29 at 11.58.46 AM.png
                            [type] => image/png
                            [tmp_name] => /tmp/phpOATbcM
                            [error] => 0
                            [size] => 87232
                        )

                )

        )

    [5] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-admin/includes/file.php
            [line] => 449
            [function] => _wp_handle_upload
            [args] => Array
                (
                    [0] => Array
                        (
                            [name] => Screen Shot 2016-08-29 at 11.58.46 AM.png
                            [type] => image/png
                            [tmp_name] => /tmp/phpOATbcM
                            [error] => 0
                            [size] => 87232
                        )

                    [1] => Array
                        (
                            [test_form] => 
                        )

                    [2] => 2016-08-29 12:52:30
                    [3] => wp_handle_upload
                )

        )

    [6] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-admin/includes/media.php
            [line] => 282
            [function] => wp_handle_upload
            [args] => Array
                (
                    [0] => Array
                        (
                            [name] => Screen Shot 2016-08-29 at 11.58.46 AM.png
                            [type] => image/png
                            [tmp_name] => /tmp/phpOATbcM
                            [error] => 0
                            [size] => 87232
                        )

                    [1] => Array
                        (
                            [test_form] => 
                        )

                    [2] => 2016-08-29 12:52:30
                )

        )

    [7] => Array
        (
            [file] => /srv/www/{CLIENT}/htdocs/wp-admin/async-upload.php
            [line] => 91
            [function] => media_handle_upload
            [args] => Array
                (
                    [0] => async-upload
                    [1] => 0
                )

        )

)

[29-Aug-2016 19:52:31 UTC] PHP Fatal error:  Cannot use object of type WP_Error as array in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-helper.php on line 413
[29-Aug-2016 19:55:00 UTC] PHP Notice:  add_utility_page is <strong>deprecated</strong> since version 4.5.0! Use add_menu_page() instead. in /srv/www/{CLIENT}/htdocs/wp-includes/functions.php on line 3706
[29-Aug-2016 19:55:01 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1165
[29-Aug-2016 19:55:01 UTC] PHP Warning:  array_flip() expects parameter 1 to be array, object given in /srv/www/{CLIENT}/htdocs/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1165
@stevegrunwell stevegrunwell added the type:bug Something isn’t working. label Aug 29, 2016
@stevegrunwell stevegrunwell added this to the 4.0.0 milestone Aug 29, 2016
@lukaspawlik
Copy link
Contributor

@stevegrunwell please pull the code now. Should be okay.

lukaspawlik pushed a commit that referenced this issue Sep 1, 2016
Added PHP and WP version checks
@jperalesHogarth jperalesHogarth mentioned this issue May 30, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn’t working.
Projects
None yet
Development

No branches or pull requests

2 participants