Skip to content

CO-2265_Fix_Tablelocator_get_error #30

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/Lib/Identifier/Sequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/src/Lib/Match/MatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions app/src/Lib/Traits/MatchgridLinkTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down