From 5941470aa4a78b6c009d5a5f4cfd9c5220219879 Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Thu, 11 Jan 2024 09:53:02 -0500 Subject: [PATCH] AppController fix for ApiSource (CFM-115) --- app/src/Controller/AppController.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index f2128d9d2..d8665cd9a 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -554,19 +554,19 @@ protected function setCO() { approach below. $CoIdEventListener = new CoIdEventListener($coid); EventManager::instance()->on($CoIdEventListener);*/ - } - - // Walk through the first level associations and pass the CO ID to them, - // as well. We could ultimately cascade this via the table once we have - // a use case to do so, though note it's possible a child associations - // wants the CO ID even though the parent doesn't. - - foreach($this->$modelsName->associations()->getIterator() as $a) { - $aTable = $a->getTarget(); - if(method_exists($aTable, "acceptsCoId") - && $aTable->acceptsCoId()) { - $aTable->setCurCoId((int)$coid); + // Walk through the first level associations and pass the CO ID to them, + // as well. We could ultimately cascade this via the table once we have + // a use case to do so, though note it's possible a child associations + // wants the CO ID even though the parent doesn't. + + foreach($this->$modelsName->associations()->getIterator() as $a) { + $aTable = $a->getTarget(); + + if(method_exists($aTable, "acceptsCoId") + && $aTable->acceptsCoId()) { + $aTable->setCurCoId((int)$coid); + } } } }