mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-17 16:58:51 +00:00
[ticket/12435] purge_notifications() fails for unused notifications
https://tracker.phpbb.com/browse/PHPBB3-12435 PHPBB3-12435
This commit is contained in:
parent
bec9b7c34e
commit
cb97c26e88
1 changed files with 19 additions and 8 deletions
|
@ -759,6 +759,12 @@ class manager
|
||||||
* @param string $notification_type_name Type identifier of the subscription
|
* @param string $notification_type_name Type identifier of the subscription
|
||||||
*/
|
*/
|
||||||
public function purge_notifications($notification_type_name)
|
public function purge_notifications($notification_type_name)
|
||||||
|
{
|
||||||
|
// If the notification was never used, it was never put in the database and so its id was never cached.
|
||||||
|
// If this notification was added by an extension, this one will call purge_notification in the purge step,
|
||||||
|
// and get_notification_type_id() will throw an exception.
|
||||||
|
// The notification was never used, thus we can silently drop the exception.
|
||||||
|
try
|
||||||
{
|
{
|
||||||
$notification_type_id = $this->get_notification_type_id($notification_type_name);
|
$notification_type_id = $this->get_notification_type_id($notification_type_name);
|
||||||
|
|
||||||
|
@ -772,6 +778,11 @@ class manager
|
||||||
|
|
||||||
$this->cache->destroy('notification_type_ids');
|
$this->cache->destroy('notification_type_ids');
|
||||||
}
|
}
|
||||||
|
catch (\phpbb\notification\exception $e)
|
||||||
|
{
|
||||||
|
// Continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable all notifications of a certain type
|
* Enable all notifications of a certain type
|
||||||
|
|
Loading…
Add table
Reference in a new issue