From 5bc7d8e226ce910d1134fadd80fec46bf5e42e1a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 11 Apr 2017 19:06:47 +1000 Subject: [PATCH] Reformat hard code list as per suggestion from Tim --- Civi/API/Subscriber/ChainSubscriber.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Civi/API/Subscriber/ChainSubscriber.php b/Civi/API/Subscriber/ChainSubscriber.php index 5906878f69..663eee14f3 100644 --- a/Civi/API/Subscriber/ChainSubscriber.php +++ b/Civi/API/Subscriber/ChainSubscriber.php @@ -127,9 +127,12 @@ class ChainSubscriber implements EventSubscriberInterface { // Hard coded list of entitys that have fields starting api_ and shouldn't be automatically // deemed to be chained API calls - if ((($subEntity == 'type' || $subEntity == 'url') && $entity == 'SmsProvider') || - ($entity == 'Job' && ($subEntity == 'prefix' || $subEntity == 'entity' || $subEntity == 'action')) || - ($entity == 'Contact' && $subEntity == 'key')) { + $skipList = array( + 'SmsProvider' => array('type', 'url', 'params'), + 'Job' => array('prefix', 'entity', 'action'), + 'Contact' => array('key'), + ); + if (isset($skipList[$entity]) && in_array($subEntity, $skipList[$entity])) { continue; } -- 2.25.1