Fix PHP 8+ undefined array key warning in merge_extra_image_details#752
Fix PHP 8+ undefined array key warning in merge_extra_image_details#752rollecode wants to merge 1 commit into
Conversation
|
Hi @ronilaukkarinen, thank you for opening this PR!
Do you have an extended log of the error? |
|
We had endless warnings like this before my patch: I think we don't have any third party stuff interfering. |
|
Thanks for the follow-up. Sorry for the delay. All TSF internal generators and bundled compatibility generators yield In a GitHub search, I found that "Tampere WordPress Multisite Base Theme" has the ID omitted, but in "Tampere Multisite Theme For Tredu," they applied it correctly. Are you using that theme? If not, please search the codebase for If there is no attachment ID, set |
Problem
Accessing
$details['id']directly on line 692 triggers a PHP 8+ warning when the array key doesn't exist:Solution
Replace
if ( $details['id'] )withif ( ! empty( $details['id'] ) )to safely check the key existence before accessing it.This PR adds the fix.