From 05ab40a46e7496b92141c226f4c5b54d71b13277 Mon Sep 17 00:00:00 2001 From: Mathias Mueller Date: Thu, 19 Oct 2017 11:51:55 +0200 Subject: [PATCH] Prevent fetching publications if there are no entities to track. --- src/JsonClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/JsonClient.php b/src/JsonClient.php index 4cdc1e6..61e7853 100644 --- a/src/JsonClient.php +++ b/src/JsonClient.php @@ -419,6 +419,10 @@ protected function joinValues(array $json, array $keys) { * {@inheritdoc} */ public function trackUsage(array $used_entities, $path, $published, $type) { + if (empty($used_entities)) { + // No need to fetch publications, if we don't have entities to track. + return; + } $dcx_status = $published ? 'pubstatus-published' : 'pubstatus-unpublished';