From a09a0148c2354a3aca4fac132054f7c652c9defd Mon Sep 17 00:00:00 2001 From: marcdeb1 Date: Wed, 19 Dec 2018 00:12:14 +0100 Subject: [PATCH] Fix claim page bugs --- src/Controller/MainController.php | 3 +-- src/Template/Main/claims.ctp | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 69c77d2..056c958 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -171,8 +171,7 @@ class MainController extends AppController { $this->set('currentPage', $page); $this->set('claims', $claims); } else { - $claim = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_id' => $id])->order(['Claims.created_at' => 'DESC'])->first(); - + $claim = $this->Claims->find()->select($this->Claims)->select(['Claims__publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_id' => $id])->order(['Claims.created_at' => 'DESC'])->first(); if (!$claim) { return $this->redirect('/'); } diff --git a/src/Template/Main/claims.ctp b/src/Template/Main/claims.ctp index 4a17312..182112c 100644 --- a/src/Template/Main/claims.ctp +++ b/src/Template/Main/claims.ctp @@ -75,7 +75,7 @@ if (strlen(trim($desc)) == 0) {
- claim_type == 2): ?> + claim_type == 1): ?>
Published By
publisher)): ?> @@ -92,7 +92,7 @@ if (strlen(trim($desc)) == 0) {
Transaction ID
- claim_type == 2): ?> + claim_type == 1): ?>
Cost
Safe for Work
@@ -120,8 +120,10 @@ if (strlen(trim($desc)) == 0) {
author)) > 0 ? $claim->author : 'Unspecified' ?>
content_type)) > 0 ? $claim->content_type : 'Unspecified' ?>
+ +
Language