From 8e7b1f42bd9538188897b39fb004c2ac491d8942 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 17 Jun 2017 18:47:16 +0100 Subject: [PATCH] temporary workaround for duplicate claim id --- src/Controller/MainController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index c7d5ffc..0daf26f 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -160,7 +160,7 @@ class MainController extends AppController { $this->set('currentPage', $page); $this->set('claims', $claims); } else { - $claim = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['ClaimId', 'Name']]])->where(['Claims.ClaimId' => $id])->first(); + $claim = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['ClaimId', 'Name']]])->where(['Claims.ClaimId' => $id])->order(['Claims.Created' => 'DESC'])->first(); if (!$claim) { return $this->redirect('/'); }