Skip to content

Commit

Permalink
Fix deprecations (#22, NOJIRA)
Browse files Browse the repository at this point in the history
Co-authored-by: Ioannis Igoumenos <ioigoume@admin.grnet.gr>
  • Loading branch information
Ioannis and Ioannis Igoumenos authored Apr 27, 2022
1 parent 88e7a41 commit 54f7680
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/src/Command/DatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
$toSql = $schema->toSql($conn->getDatabasePlatform());

// SchemaManager provides info about the database
$sm = $conn->getSchemaManager();
$sm = $conn->createSchemaManager();

// The is the current database representation
$curSchema = $sm->createSchema();
Expand Down Expand Up @@ -282,7 +282,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
$io->out("Skipping sequence drop");
} else {
if($doSQL) {
$stmt = $conn->query($sql);
$stmt = $conn->executeQuery($sql);
// $stmt just returns the query string so we don't bother examining it
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/Command/TransmogrifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
// data here, and also we're executing a maintenance operation (so query
// optimization is less important)
$outsql = "ALTER SEQUENCE " . $t . "_id_seq RESTART WITH " . $max;
$this->outconn->query($outsql);
$this->outconn->executeQuery($outsql);

// Run any post processing functions for the table.

Expand Down
2 changes: 1 addition & 1 deletion app/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function getPrimaryLink(bool $lookup=false) {
// Look up the link value to find the related entity

$linkTableName = $this->$modelsName->getPrimaryLinkTableName($this->cur_pl->attr);
$linkTable = TableRegistry::get($linkTableName);
$linkTable = $this->getTableLocator()->get($linkTableName);

$this->set('vv_primary_link_model', $linkTableName);

Expand Down
8 changes: 4 additions & 4 deletions app/src/Controller/MVEAController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
if(!empty($link->value)) {
$this->set('vv_primary_link_id', $link->value);

$Names = TableRegistry::get('Names');
$Names = $this->getTableLocator()->get('Names');

switch($link->attr) {
case 'external_identity_role_id':
$ExternalIdentityRoles = TableRegistry::get('ExternalIdentityRoles');
$ExternalIdentityRoles = $this->getTableLocator()->get('ExternalIdentityRoles');
$roleEntity = $ExternalIdentityRoles->findById((int)$link->value)->firstOrFail();

// Note this is a string, but vv_person_name is an entity
$this->set('vv_ei_role', $ExternalIdentityRoles->generateDisplayField($roleEntity));
$this->set('vv_ei_role_id', $link->value);
// fall through
case 'external_identity_id':
$ExternalIdentity = TableRegistry::get('ExternalIdentities');
$ExternalIdentity = $this->getTableLocator()->get('ExternalIdentities');

// What's the Person ID for the ExternalIdentity?
$eiId = isset($roleEntity) ? $roleEntity->external_identity_id : $link->value;
Expand All @@ -84,7 +84,7 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
$this->set('vv_person_id', $externalIdentity->person_id);
break;
case 'person_role_id':
$PersonRoles = TableRegistry::get('PersonRoles');
$PersonRoles = $this->getTableLocator()->get('PersonRoles');
$roleEntity = $PersonRoles->findById((int)$link->value)->firstOrFail();
// Note this is a string, but vv_person_name is an entity
$this->set('vv_person_role', $PersonRoles->generateDisplayField($roleEntity));
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/ApiUsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function validationDefault(Validator $validator): Validator {
$validator->add('co_id', [
'content' => ['rule' => 'isInteger']
]);
$validator->notEmpty('co_id');
$validator->notEmptyString('co_id');

$this->registerStringValidation($validator, $schema, 'username', true);

Expand Down

0 comments on commit 54f7680

Please sign in to comment.