mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-19 01:38:54 +00:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12435] Update the comment [ticket/12435] purge_notifications() fails for unused notifications
This commit is contained in:
commit
d867e52a2e
1 changed files with 21 additions and 8 deletions
|
@ -759,6 +759,14 @@ 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 a notification is never used, its type will not be added to the database
|
||||||
|
// nor its id cached. If this method is called by an extension during the
|
||||||
|
// purge step, and that extension never used its notifications,
|
||||||
|
// get_notification_type_id() will throw an exception. However,
|
||||||
|
// because no notification type was added to the database,
|
||||||
|
// there is nothing to delete, so 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 +780,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