• Resolved krasi1

    (@krasi1)


    Uploading a 40mb video causes an error – Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.

    The fix:

    PHP Fatal error: Uncaught TypeError: Argument 1 passed to WebpConverter\Action\UploadFileHandler::init_attachment_conversion() must be of the type array or null, bool given, called in /wp-includes/class-wp-hook.php on line 324 and defined in /wp-content/plugins/webp-converter-for-media/src/Action/UploadFileHandler.php:75

    • Old code in line 75: public function init_attachment_conversion( array $data = null, int $attachment_id = null ) 
    • New code in line 75: public function init_attachment_conversion($data,$attachment_id) 

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @krasi1,

    Thank you for your message.

    Does this problem affect all videos or just this one 40 MB video? What format are you sending this video in?

    Best,
    Mateusz

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    On line 75 that you mentioned, I have the following code.

    There I use the wp_update_attachment_metadata filter, which is described in the WordPress documentation. According to this documentation, the first argument of the function is an array. The error you mention is that a boolean value was passed to this filter as the first argument. There is an error in my plugin code because my plugin supports an array as its first argument. My plugin does this according to the WordPress documentation – a boolean value should never appear as the first argument in this filter.

    You probably have some other plugin that is involved in the file transfer process. This function also uses the wp_update_attachment_metadata filter, but changes the value to a boolean value. This is against the WordPress documentation.

    If you need additional explanation, I will be happy to explain it to you. I would start looking for the source of the problem by trying to disable various plugins and see when the problem goes away. Leave my plugin active. When you disable the plugin that modified the value using the wp_update_attachment_metadata filter, the error in my plugin will no longer appear.

    Thread Starter krasi1

    (@krasi1)

    confirmed, the issue was with the media folder plugin, can close it

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @krasi1 Thank you for the confirmation! Can you tell me what exactly the plugin was, please? Was it its default settings or some specific settings?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Uploading a 40mb video causes an error – Unexpected response from the server’ is closed to new replies.