-2

I have problem every time I try to actualize Elementor from 3.9.2 to 3.10 - I see an error "Warning: Undefined array key "file" in (...)/wp-includes/media.php on line 1680". It appears at the bottom of my homepage. After backup everything's working well.

The code is:

// Bail early if an image has been inserted and later edited.
if ( preg_match( '/-e[0-9]{13}/', $image_meta['file'], $img_edit_hash ) &&
    strpos( wp_basename( $image_src ), $img_edit_hash[0] ) === false ) {

    return $image;
}

I'm a noob un php so I need some help to fix it. Don't know what to do. It may be helpful to know that I have set short film as a background in first section on homepage.

I tried to find this array definition but I have no idea wehere it is. I used @ in code but I know it's not recommended so I want to find better solution

// Bail early if an image has been inserted and later edited.
if ( preg_match( '/-e[0-9]{13}/', $@image_meta['file'], $img_edit_hash ) &&
strpos( wp_basename( $image_src ), $img_edit_hash[0] ) === false ) {

   return $image;
}
  • 1
    Does this answer your question? ["Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP](https://stackoverflow.com/questions/4261133/notice-undefined-variable-notice-undefined-index-warning-undefined-arr) – user1844933 Jan 22 '23 at 13:54
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jan 23 '23 at 08:52

1 Answers1

-1

Found this: https://wordpress.org/support/topic/bug-with-php-8-0-version/

So one way is to decrease PHP version to 7.4.