It's (only) a warning, either disable displaying deprecated and warning messages (because it effectively may break functionality of a page even if nothing else is broken), in local config
$conf['show_php_errors_on_frontend'] = false;
or fine tune message classes to display, see
[Forum, post 183126 by erAck in topic 31852] Menubar tags issue after 12.2.0 upgrade, or better, log to file instead.
See
[Forum, post 180778 by erAck in topic 31258] Error Message.