Skip to content

Commit

Permalink
Miscellaneous patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 19, 2021
1 parent 1cb2f0b commit 7b4be0c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
15 changes: 14 additions & 1 deletion app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,20 @@ public function index() {
// where the link attribute is NULL
$query = $this->$modelsName->find()->where([$link['linkattr'].' IS' => $this->request->getQuery($link['linkattr'])]);
} else {
$query = $this->$modelsName->find();
try {
$query = $this->$modelsName->find();
}
catch(\Cake\Database\Exception $e) {
if($modelsName == 'MatchgridRecords' && $e->getCode() == 500) {
$this->Flash->error(__('match.er.mg.notfound', [$e->getMessage()]));

return $this->redirect([
'controller' => 'matchgrids',
'action' => 'manage',
$this->cur_mg->id
]);
}
}
}

$this->set($tableName, $this->Paginator->paginate($query, $this->paginate));
Expand Down
6 changes: 6 additions & 0 deletions app/src/Locale/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ msgstr "Loading records to matchgrid table mg_{0}"
msgid "match.cmd.bl.summary"
msgstr "Finished processing {0} records ({1} errors, {2} unresolved matches, total elapsed time {3} seconds)"

msgid "match.cmd.db.noop"
msgstr "SQL NOT EXECUTED"

msgid "match.cmd.db.ok"
msgstr "Database schema update successful"

Expand Down Expand Up @@ -231,6 +234,9 @@ msgstr "When this value is selected, {0} cannot be empty"
msgid "match.er.input.invalid"
msgstr "Invalid character found"

msgid "match.er.mg.notfound"
msgstr "Matchgrid table not found, was the Matchgrid built? ({0})"

msgid "match.er.mgid"
msgstr "Could not find Matchgrid ID in request"

Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/MatchgridRecordsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function initialize(array $config) {
// We allow unkeyed primary link here because a record ID is not by itself
// sufficient to identify a matchgrid, since each matchgrid gets its own
// physical table.
$this->setAllowUnkeyedPrimaryLink(['edit']);
$this->setAllowUnkeyedPrimaryLink(['delete', 'edit']);

$this->setAutoViewVars([
'sor' => [
Expand Down
3 changes: 2 additions & 1 deletion app/src/Model/Table/RulesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function initialize(array $config) {
'attributes' => [
'type' => 'auxiliary',
'model' => 'Attributes',
'find' => 'filterPrimaryLink'
'find' => 'filterPrimaryLink',
'order' => ['name' => 'ASC']
],
'confidenceModes' => [
'type' => 'enum',
Expand Down

0 comments on commit 7b4be0c

Please sign in to comment.