mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 18:24:35 -04:00
Fixes for setup page flow
This commit is contained in:
parent
fe3242a095
commit
dea5543c06
@ -15,15 +15,16 @@ use Exception;
|
|||||||
use Illuminate\Auth\Access\AuthorizationException;
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||||
|
use Illuminate\Database\Eloquent\RelationNotFoundException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
use Sentry\State\Scope;
|
||||||
use Symfony\Component\Debug\Exception\FatalThrowableError;
|
use Symfony\Component\Debug\Exception\FatalThrowableError;
|
||||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Illuminate\Database\Eloquent\RelationNotFoundException;
|
|
||||||
use Sentry\State\Scope;
|
|
||||||
use function Sentry\configureScope;
|
use function Sentry\configureScope;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
@ -55,9 +56,12 @@ class Handler extends ExceptionHandler
|
|||||||
*/
|
*/
|
||||||
public function report(Exception $exception)
|
public function report(Exception $exception)
|
||||||
{
|
{
|
||||||
|
if(!Schema::hasTable('accounts'))
|
||||||
|
return;
|
||||||
|
|
||||||
if (app()->bound('sentry') && $this->shouldReport($exception)) {
|
if (app()->bound('sentry') && $this->shouldReport($exception)) {
|
||||||
app('sentry')->configureScope(function (Scope $scope): void {
|
app('sentry')->configureScope(function (Scope $scope): void {
|
||||||
if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
|
if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
|
||||||
$scope->setUser([
|
$scope->setUser([
|
||||||
'id' => auth()->guard('contact')->user()->company->account->key,
|
'id' => auth()->guard('contact')->user()->company->account->key,
|
||||||
'email' => "anonymous@example.com",
|
'email' => "anonymous@example.com",
|
||||||
|
@ -23,6 +23,7 @@ use App\Utils\Traits\AppSetup;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Request as Input;
|
use Illuminate\Support\Facades\Request as Input;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
use League\Fractal\Manager;
|
use League\Fractal\Manager;
|
||||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||||
use League\Fractal\Resource\Collection;
|
use League\Fractal\Resource\Collection;
|
||||||
@ -319,7 +320,7 @@ class BaseController extends Controller
|
|||||||
// return redirect()->secure(request()->path());
|
// return redirect()->secure(request()->path());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ((bool)$this->checkAppSetup() !== false && $account = Account::all()->first()) {
|
if ((bool)$this->checkAppSetup() !== false && Schema::hasTable('accounts') && $account = Account::all()->first()) {
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
if (Ninja::isSelfHost()) {
|
if (Ninja::isSelfHost()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user