Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #30 from loannis/CO-2265_Fix_Tablelocator_get_error
CO-2265_Fix_Tablelocator_get_error
arlen committed Nov 8, 2021
2 parents 009a476 + 388cead commit 92f38bd
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/Lib/Identifier/Sequence.php
@@ -41,7 +41,7 @@ class Sequence extends ReferenceIdService {
*/

public function generate(\App\Model\Entity\Matchgrid $mgConfig, \ADOConnection $dbc) {
$MatchgridSettings = Cake\Datasource\FactoryLocator::get('MatchgridSettings');
$MatchgridSettings = Cake\Datasource\FactoryLocator::get('Table')->get('MatchgridSettings');

// We'll use the matchgrid ID rather than name in the sequence name to avoid
// issues if the matchgrid is renamed for some reason.
2 changes: 1 addition & 1 deletion app/src/Lib/Match/MatchService.php
@@ -104,7 +104,7 @@ public function attachReferenceId(string $sor, string $sorid, AttributeManager $
*/

protected function generateReferenceId() {
$MatchgridSettings = FactoryLocator::get('MatchgridSettings');
$MatchgridSettings = FactoryLocator::get('Table')->get('MatchgridSettings');

if($MatchgridSettings->getReferenceIdMethod($this->mgConfig->id) == ReferenceIdEnum::Sequence) {
$IdService = new \App\Lib\Identifier\Sequence;
4 changes: 2 additions & 2 deletions app/src/Lib/Traits/MatchgridLinkTrait.php
@@ -79,8 +79,8 @@ public function calculateMatchgridId(int $id) {
// Look up $linkAttr to get its Matchgrid. We currently assume only
// one level of nesting.

$linkTable = FactoryLocator::get($this->getPrimaryLinkTableName());
$linkTable = FactoryLocator::get('Table')->get($this->getPrimaryLinkTableName());

return $linkTable->calculateMatchgridId($obj->$linkAttr);
}
}

0 comments on commit 92f38bd

Please sign in to comment.