• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug Need to explicitly define variables (notices_prepare)

Robust

Well-known member
#1
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?
 

Mike

XenForo developer
Staff member
#2
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.