From d5209e359a255cf09afdb0d95db6b5b85ac14083 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Fri, 15 Aug 2025 13:28:51 +0000 Subject: [PATCH] Fix deprecation warning after framework major upgrade --- .../src/Model/Table/PersonRoleMappersTable.php | 2 +- .../src/Model/Table/AttributeCollectorsTable.php | 2 +- .../CoreEnroller/src/Model/Table/EmailVerifiersTable.php | 2 +- .../src/View/Cell/AttributeCollectorsCell.php | 2 +- app/src/Controller/Component/RegistryAuthComponent.php | 8 +++++--- app/src/Lib/Traits/AutoViewVarsTrait.php | 8 ++++---- app/src/Model/Table/PeopleTable.php | 8 ++++---- app/templates/element/subnavigation/supertitle.php | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/availableplugins/PipelineToolkit/src/Model/Table/PersonRoleMappersTable.php b/app/availableplugins/PipelineToolkit/src/Model/Table/PersonRoleMappersTable.php index 9bdd1bf90..9dc38c1b4 100644 --- a/app/availableplugins/PipelineToolkit/src/Model/Table/PersonRoleMappersTable.php +++ b/app/availableplugins/PipelineToolkit/src/Model/Table/PersonRoleMappersTable.php @@ -109,7 +109,7 @@ public function buildPersonRole( // We need our Mapping configuration, which won't be in $flange $mappings = $this->PersonRoleMappings->find() ->where(['person_role_mapper_id' => $flange->person_role_mapper->id]) - ->order(['ordr' => 'ASC']) + ->orderBy(['ordr' => 'ASC']) ->all(); foreach($mappings as $mapping) { diff --git a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php index a37f486ba..930ee179d 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php @@ -442,7 +442,7 @@ public function verifiableEmailAddresses( 'attribute' => 'emailAddress', 'status' => StatusEnum::Active, ]) - ->order(['ordr' => 'ASC']) + ->orderBy(['ordr' => 'ASC']) ->toArray(); if (empty($vv_enrollment_attributes)) { diff --git a/app/plugins/CoreEnroller/src/Model/Table/EmailVerifiersTable.php b/app/plugins/CoreEnroller/src/Model/Table/EmailVerifiersTable.php index 3771e6205..edd67fc1f 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/EmailVerifiersTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/EmailVerifiersTable.php @@ -189,7 +189,7 @@ public function assembleVerifiableAddresses( 'enrollment_flow_id' => $petition->enrollment_flow_id, 'status' => SuspendableStatusEnum::Active ]) - ->order(['EnrollmentFlowSteps.ordr' => 'ASC']) + ->orderBy(['EnrollmentFlowSteps.ordr' => 'ASC']) ->contain($this->EnrollmentFlowSteps->getPluginRelations()) ->all(); diff --git a/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php index 9b3158ed4..87665564a 100644 --- a/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php +++ b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php @@ -96,7 +96,7 @@ public function display(int $petitionId): void $vv_enrollment_attributes = $this->fetchTable('EnrollmentAttributes') ->find() ->where(fn(QueryExpression $exp, Query $q) => $exp->in('id', $vv_enrollment_atttributes_ids)) - ->order(['ordr' => 'ASC']) + ->orderBy(['ordr' => 'ASC']) ->toArray(); } diff --git a/app/src/Controller/Component/RegistryAuthComponent.php b/app/src/Controller/Component/RegistryAuthComponent.php index b5145b177..48f3f6349 100644 --- a/app/src/Controller/Component/RegistryAuthComponent.php +++ b/app/src/Controller/Component/RegistryAuthComponent.php @@ -152,7 +152,8 @@ public function beforeFilter(EventInterface $event) { break; case 'open': // The current request is open/public, no auth required - return true; + $event->setResult(true); + return; break; case 'no': // The controller will not do either authn or authz, so apply @@ -162,7 +163,8 @@ public function beforeFilter(EventInterface $event) { // The controller will handle both authn and authz, simply return // (The expectation is that the controller already performed the appropriate // checks before returning 'yes', on failure 'notauth' should be returned.) - return true; + $event->setResult(true); + return; break; case 'notauth': // The controller has rejected this request as unauthenticated or unauthorized @@ -823,7 +825,7 @@ public function isApprover(int $petitionId): bool { $Identifiers = TableRegistry::getTableLocator()->get('Identifiers'); // Pull the Petition to find its CO - $petition = $Petitions->get($petitionId, ['contain' => 'EnrollmentFlows']); + $petition = $Petitions->get($petitionId, contain: ['EnrollmentFlows']); try { // Map the authenticated user to a Person ID diff --git a/app/src/Lib/Traits/AutoViewVarsTrait.php b/app/src/Lib/Traits/AutoViewVarsTrait.php index 21f8888a3..2f3b95b6f 100644 --- a/app/src/Lib/Traits/AutoViewVarsTrait.php +++ b/app/src/Lib/Traits/AutoViewVarsTrait.php @@ -234,10 +234,10 @@ public function calculateAutoViewVars(int|null $coId, Object $obj = null): \Gene // For now we don't filter on status because not all Pluggable models // use it consistency. (Specifically, EISs use SyncModeEnum instead.) - $generatedValue = $PluggableTable->find('list', [ - 'keyField' => $modelKey.'.id', - 'valueField' => 'description' - ]) + $generatedValue = $PluggableTable->find('list', + keyField: $modelKey.'.id', + valueField: 'description' + ) ->where(['plugin' => $avv['model']]) ->contain(StringUtilities::pluginModel($avv['model'])) ->all(); diff --git a/app/src/Model/Table/PeopleTable.php b/app/src/Model/Table/PeopleTable.php index 275c58328..8b43ab229 100644 --- a/app/src/Model/Table/PeopleTable.php +++ b/app/src/Model/Table/PeopleTable.php @@ -465,10 +465,10 @@ public function localAfterSave(\Cake\Event\EventInterface $event, \Cake\Datasour public function marshalProvisioningData(int $id): array { $ret = []; - $ret['data'] = $this->get($id, [ + $ret['data'] = $this->get($id, // We need archives for handling deleted records - 'archived' => 'true', - 'contain' => [ + archived: 'true', + contain: [ 'PrimaryName' => [ 'Types' ], 'Addresses' => [ 'Types' ], 'AdHocAttributes', @@ -506,7 +506,7 @@ public function marshalProvisioningData(int $id): array { 'TelephoneNumbers' => [ 'Types' ], 'Urls' => [ 'Types' ] ] - ]); + ); // Provisioning Eligibility is // - Deleted if the changelog deleted flag is true OR status is Archived diff --git a/app/templates/element/subnavigation/supertitle.php b/app/templates/element/subnavigation/supertitle.php index c7354fa47..71d6a4205 100644 --- a/app/templates/element/subnavigation/supertitle.php +++ b/app/templates/element/subnavigation/supertitle.php @@ -64,7 +64,7 @@ && !empty($this->getPlugin()) && $vv_subnavigation_tabs[0] !== StringUtilities::entityToClassName($vv_bc_parent_obj) ) { - $object = $vv_obj ?? $$objectName?->first(); + $object = $vv_obj ?? $$objectName?->items()?->first(); if ($object === null) { // This is a deep nested association that has not been initialized yet. The controller name // will become the supertitle