Editing Featured Image on CPT causes warnings

Support MB Custom Post Type Editing Featured Image on CPT causes warnings

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #41940
    TanyaTanya
    Participant

    If I try to edit a featured image on a CPT I get about 100 of these PHP warnings in my error log

    [26-May-2023 03:51:54 UTC] PHP Warning: Attempt to read property "id" on null in /home/xxx/public_html/wp-content/plugins/meta-box/inc/media-modal.php on line 102

    Any idea how to make it stop?

    #41943
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Same problem, here also.

    #41948
    PeterPeter
    Moderator

    Hello,

    I see that issue. I've escalated it to the development team to fix it in the next update.

    Thanks.

    #41990
    digitaalitoimistodigitaalitoimisto
    Participant

    Meanwhile, if its annoying, add the bolded part to the file and line in the error

            
    private function is_attachment_edit_screen(): bool {
      return <strong>get_current_screen() &&</strong> get_current_screen()->id === 'attachment';
    }
    #41991
    digitaalitoimistodigitaalitoimisto
    Participant

    Ugh, bold didn't work inside code and cant edit 😀 remove the tags of course, so the line should be
    return get_current_screen() && get_current_screen()->id === 'attachment';

    #41992
    digitaalitoimistodigitaalitoimisto
    Participant

    Why there is no edit 😀 cumbersome

    #42021
    PeterPeter
    Moderator

    Hello,

    This issue has been fixed in this commit https://github.com/wpmetabox/meta-box/commit/191e00e11fc372219307044472d85b59ae6412a5
    You can try to apply it on your site while waiting for the new update of Meta Box.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.