mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15540] Trigger errors when search module not found
PHPBB3-15540
This commit is contained in:
@@ -1086,8 +1086,22 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
}
|
||||
|
||||
// Remove the message from the search index
|
||||
$search_backend_factory = $phpbb_container->get('search.backend_factory');
|
||||
$search = $search_backend_factory->get_active();
|
||||
try
|
||||
{
|
||||
$search_backend_factory = $phpbb_container->get('search.backend_factory');
|
||||
$search = $search_backend_factory->get_active();
|
||||
}
|
||||
catch (RuntimeException $e)
|
||||
{
|
||||
if (strpos($e->getMessage(), 'No service found') === 0)
|
||||
{
|
||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||
}
|
||||
else
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
$search->index_remove($post_ids, $poster_ids, $forum_ids);
|
||||
|
||||
|
Reference in New Issue
Block a user