Not a bug Need to explicitly define variables (notices_prepare)


Well-known member
For the code event notices_prepare (in ViewRenderer/HtmlPublic, _getNoticesContainerParams) if we're calling that event and adding a notice to $noticesList, we need to explicitly define every attribute, leading to mess like this:

$noticeList['confirm_test'] = array(
'title' => 'Confirm Test',
'message' => 'hi',
'wrap' => true,
'dismissible' => false,
'delay_duration' => '',
'display_duration' => '',
'auto_dismiss' => false,
'display_image' => '',
'display_style' => '',
'css_class' => '',
'visibility' => '',
'notice_type' => 'block'
Shouldn't XF be defining default data, not us?


XenForo developer
Staff member
If you're pushing to $noticeList, then that's expected to be notice records that are complete, so we assume they'll have all the keys we need.