Skip to content

CFM-274_Breadcrumps_fixes #171

merged 6 commits into from Mar 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
setCurCoId only if a coId is available
Ioannis committed Mar 12, 2024
commit cc8dcf950667cb992230ac43c8e7f13f77533061
12 changes: 7 additions & 5 deletions app/src/Controller/AppController.php
@@ -118,18 +118,20 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
// Determine the requested CO
$this->setCO();

// We need to manually set the Current CO ID for models with dynamic
// validation rules. Plugins can implement calculateRequestedCOID() to tell
// We need to manually set the Current CO ID for models with dynamic validation rules.
// Plugins can implement calculateRequestedCOID() to tell
// AppController what the current CO is, we then pass that information
// manually here.

// It's not ideal to have a hardcoded list of models, but we don't have
// a better solution at the moment.

foreach(['Addresses', 'Names', 'TelephoneNumbers'] as $m) {
$Table = TableRegistry::getTableLocator()->get($m);
if($this->getCOID() !== null) {
foreach(['Addresses', 'Names', 'TelephoneNumbers'] as $m) {
$Table = TableRegistry::getTableLocator()->get($m);

$Table->setCurCoId($this->getCOID());
$Table->setCurCoId($this->getCOID());
}
}

if(isset($this->RegistryAuth)) {