The only way I can see this happening is if there are no alerts left to send when Pushover tries to send them out. This is actually perfectly normal under default XenForo operation (although should be a very rare occurrence unless something weird is going on).
In
bdPushover/Helper/Alert.php, I see:
Code:
$alerts = array($alert['alert_id'] => $alert);
$alerts = self::_getAlertModel()->bdPushover_getContentForAlerts($alerts, $assoc['user_id'], $assoc);
$alerts = self::_getAlertModel()->prepareAlerts($alerts, $assoc);
$handlers = self::_getAlertModel()->bdPushover_getHandlerCache();
$alerts = XenForo_ViewPublic_Helper_Alert::getTemplates($view, $alerts, $handlers);
$alertNew = array_pop($alerts);
$template = $alertNew['template'];
Let me go over this line-by-line so you can report the bug to the developer of [bd] Pushover. This is the ONLY way I can see this happening without throwing a Fatal Error in step 5.
- $alerts is defined as an array containing 1 entry which is the alert we are trying to push.
- ::_getContentForAlerts tries to set a 'content' field for each entry in $alerts. According to the definition of the original method, it will remove any entries from $alerts if one of the following is true:
- The content that sent the alert can't be found (maybe it was deleted already)
- The user doesn't have permission to see the content that sent the alert (alerts for conversations and threads filter this way). Maybe it's moderated, maybe they are ignoring the poster, who knows.
Thus, if ::_getContentForAlerts removes the 1 entry from step 1, we have an empty array. - Process any additional data needed for entries in $alerts. If there are none, nothing happens.
- Get the registered handlers for content types that might send alerts.
- Using the registered handlers, cycle through $alerts and create a 'template' field for every single entry. The function that sets this field always returns a template object (even if the template it refers to doesn't exist). Thus, for all entries in $alerts, the 'template' field is created, and it will never be NULL. If there is an entry but no handler for that entry's content type, a fatal error will be thrown (call to ::renderHtml on a non-object).
- Get the last entry in $alerts, since it's likely the newest. According to array_pop: if there are no entries, false is returned.
- Get the field 'template' from that entry. We cannot get any fields if we got false before; in this case, a warning is logged and $template = NULL.
In order to fix this bug, Pushover needs to change this:
Code:
$alertNew = array_pop($alerts);
$template = $alertNew['template'];
To this:
Code:
$alertNew = array_pop($alerts);
if (!$alertNew)
{
return false;
}
$template = $alertNew['template'];
Everywhere that calls ::work1_prepare then needs to check that it returns a valid alert before sending it to the queue (since it might return false now). Example:
Code:
$templateQueue[] = self::work1_prepare($queued[0], $queued[1]);
Should be changed to:
Code:
$prepared = self::work1_prepare($queued[0], $queued[1]);
if ($prepared)
{
$templateQueue[] = $prepared;
}
Even if you noticed this bug due to VaultWiki or due to a related bug in VaultWiki, the errors you have quoted point to the bug I've described in Pushover. For our purposes here, I'm marking this as Not a Bug.