diff --git a/app/src/Controller/MatchgridsController.php b/app/src/Controller/MatchgridsController.php index 7591d8243..ade88c7f5 100644 --- a/app/src/Controller/MatchgridsController.php +++ b/app/src/Controller/MatchgridsController.php @@ -71,7 +71,7 @@ public function build(string $id) { $this->Matchgrids->build((int)$id); $this->Flash->success(__('match.rs.build')); } - catch(Exception $e) { + catch(\Exception $e) { $this->Flash->error(__('match.er.build', [$e->getMessage()])); } diff --git a/app/src/Lib/Match/MatchgridBuilder.php b/app/src/Lib/Match/MatchgridBuilder.php index 104ad5930..0fd4b95d8 100644 --- a/app/src/Lib/Match/MatchgridBuilder.php +++ b/app/src/Lib/Match/MatchgridBuilder.php @@ -146,6 +146,10 @@ protected function configToSchema( } } + if(empty($Matchgrid->matchgrid_setting->referenceid_method)) { + throw new \InvalidArgumentException("Reference ID Method not set for Matchgrid"); + } + // If the Matchgrid uses Sequence for the referenceid_method, create the sequence if($Matchgrid->matchgrid_setting->referenceid_method == ReferenceIdEnum::Sequence) { $schema->createSequence($Matchgrid->matchgrid_setting->ref_id_sequence_name,