diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c59ba22..82978b834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Update LandingController, fix config variable names ([b716926b](https://github.com/pixelfed/pixelfed/commit/b716926b)) - Update Privacy Settings, add Directory setting ([634c15e4](https://github.com/pixelfed/pixelfed/commit/634c15e4)) - Update site config ([6d59dc8e](https://github.com/pixelfed/pixelfed/commit/6d59dc8e)) +- Update db:raw queries to support laravel v10 ([849e5103](https://github.com/pixelfed/pixelfed/commit/849e5103)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.5 (2023-03-25)](https://github.com/pixelfed/pixelfed/compare/v0.11.4...v0.11.5) diff --git a/app/Http/Controllers/Admin/AdminSettingsController.php b/app/Http/Controllers/Admin/AdminSettingsController.php index ab1a4ab5c..d51870822 100644 --- a/app/Http/Controllers/Admin/AdminSettingsController.php +++ b/app/Http/Controllers/Admin/AdminSettingsController.php @@ -243,16 +243,20 @@ trait AdminSettingsController ]; switch (config('database.default')) { case 'pgsql': + $exp = DB::raw('select version();'); + $expQuery = $exp->getValue(DB::connection()->getQueryGrammar()); $sys['database'] = [ 'name' => 'Postgres', - 'version' => explode(' ', DB::select(DB::raw('select version();'))[0]->version)[1] + 'version' => explode(' ', DB::select($expQuery)[0]->version)[1] ]; break; case 'mysql': + $exp = DB::raw('select version()'); + $expQuery = $exp->getValue(DB::connection()->getQueryGrammar()); $sys['database'] = [ 'name' => 'MySQL', - 'version' => DB::select( DB::raw("select version()") )[0]->{'version()'} + 'version' => DB::select($expQuery)[0]->{'version()'} ]; break; diff --git a/app/Jobs/CommentPipeline/CommentPipeline.php b/app/Jobs/CommentPipeline/CommentPipeline.php index e8ed821da..0ae4ed4a2 100644 --- a/app/Jobs/CommentPipeline/CommentPipeline.php +++ b/app/Jobs/CommentPipeline/CommentPipeline.php @@ -60,7 +60,9 @@ class CommentPipeline implements ShouldQueue $actor = $comment->profile; if(config('database.default') === 'mysql') { - $count = DB::select(DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $status->id]); + $exp = DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"); + $expQuery = $exp->getValue(DB::connection()->getQueryGrammar()); + $count = DB::select($expQuery, [ 'kid' => $status->id ]); $status->reply_count = count($count); $status->save(); } else { diff --git a/app/Jobs/StatusPipeline/StatusReplyPipeline.php b/app/Jobs/StatusPipeline/StatusReplyPipeline.php index c515ffed0..2c41aa146 100644 --- a/app/Jobs/StatusPipeline/StatusReplyPipeline.php +++ b/app/Jobs/StatusPipeline/StatusReplyPipeline.php @@ -70,7 +70,9 @@ class StatusReplyPipeline implements ShouldQueue } if(config('database.default') === 'mysql') { - $count = DB::select(DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $reply->id]); + $exp = DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"); + $expQuery = $exp->getValue(DB::connection()->getQueryGrammar()); + $count = DB::select($expQuery, [ 'kid' => $reply->id ]); $reply->reply_count = count($count); $reply->save(); } else { diff --git a/resources/views/admin/settings/system.blade.php b/resources/views/admin/settings/system.blade.php index c68d822f8..5d13d31cf 100644 --- a/resources/views/admin/settings/system.blade.php +++ b/resources/views/admin/settings/system.blade.php @@ -1,6 +1,4 @@ -@extends('admin.partial.template') - -@include('admin.settings.sidebar') +@extends('admin.partial.template-full') @section('section')
System information
STACK
{{$sys['pixelfed']}}
{{$sys['database']['version']}}
{{$sys['php']}}
{{$sys['laravel']}}
0.0.0
+