From 7d67c0684315add6b5273db623c70282b1e7b88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Thu, 8 Oct 2020 10:15:36 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=94=E3=82=81=E3=82=93=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Home/Content.php | 6 ++++-- app/Http/Controllers/Video/Game.php | 6 ++++-- app/Http/Controllers/Video/Prayer.php | 2 +- resources/js/bootstrap.js | 1 - resources/js/components/comments.vue | 2 +- resources/js/components/deletevideo.vue | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Home/Content.php b/app/Http/Controllers/Home/Content.php index 7fa68e7..7b1cc06 100644 --- a/app/Http/Controllers/Home/Content.php +++ b/app/Http/Controllers/Home/Content.php @@ -68,8 +68,10 @@ class Content { if (count($incomplete) > 0) $err = implode('、', $incomplete).'をご入力下さい。'; // スラッグが既に存在したら、エラーを出て - $sl = DB::table('blg_content')->select('slug')->where('slug', $r->slug)->first(); - if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。'; + if (empty($err)) { + $sl = DB::table('blg_content')->select('slug')->where('slug', $r->slug)->first(); + if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。'; + } // エラーがあったら、フォームに戻って。なければ、データベースに保存したり、ページ又はポストへ移転して if (!empty($err)) return view('pages.site.content.add', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]); diff --git a/app/Http/Controllers/Video/Game.php b/app/Http/Controllers/Video/Game.php index bb1377d..b46f654 100644 --- a/app/Http/Controllers/Video/Game.php +++ b/app/Http/Controllers/Video/Game.php @@ -44,8 +44,10 @@ class Game { if (count($incomplete) > 0) $err = implode('、', $incomplete).'をご入力下さい。'; // スラッグが既に存在したら、エラーを出て - $sl = DB::table('vid_game')->select('slug')->where('slug', $r->slug)->first(); - if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。'; + if (empty($err)) { + $sl = DB::table('vid_game')->select('slug')->where('slug', $r->slug)->first(); + if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。'; + } // エラーがあったら、フォームに戻って。なければ、データベースに保存したり、ページ又はポストへ移転して if (!empty($err)) return view('pages.site.video.game.add', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]); diff --git a/app/Http/Controllers/Video/Prayer.php b/app/Http/Controllers/Video/Prayer.php index 8ae4f24..400b8eb 100644 --- a/app/Http/Controllers/Video/Prayer.php +++ b/app/Http/Controllers/Video/Prayer.php @@ -32,7 +32,7 @@ class Prayer { $comments = DB::table('blg_comments')->where('video_id', $vid)->orderBy('id', 'asc')->get()->toArray(); $ytslug = explode('?v=', $res->youtube); - $res->ytcomment = $this->getYouTubeCome($ytslug[1]); + $res->ytcomment = (isset($ytslug[1]) ? $this->getYouTubeCome($ytslug[1]) : array()); $res->nicocomment = array(); $res->bccomment = array(); diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index b2b560c..c160141 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -26,7 +26,6 @@ Vue.component('delete-game', require('./components/deletegame.vue').default); Vue.component('discord', require('./components/discord.vue').default); const app = new Vue({ el: '#app' }); -const men = new Vue({ el: '#men' }); /** * Echo exposes an expressive API for subscribing to channels and listening diff --git a/resources/js/components/comments.vue b/resources/js/components/comments.vue index a2c3cc7..742c8ee 100644 --- a/resources/js/components/comments.vue +++ b/resources/js/components/comments.vue @@ -68,7 +68,7 @@