laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.47k stars 419 forks source link

Call to undefined method Laravel\\Lumen\\Application::getFallbackLocale() #1250

Closed DavidSchmucker closed 2 years ago

DavidSchmucker commented 2 years ago

Description:

After the last Update (2022-10-11) i get the system wide error:

{
  "errors": [
    {
      "status": "",
      "code": 0,
      "title": "Error",
      "detail": "Call to undefined method Laravel\\Lumen\\Application::getFallbackLocale()",
      "source": [],
      "meta": {
        "file": "/lumen/vendor/illuminate/translation/TranslationServiceProvider.php",
        "line": 29,
        "trace": [
          "",
          "/lumen/vendor/illuminate/container/Container.php(871): Illuminate\\Translation\\TranslationServiceProvider->Illuminate\\Translation\\{closure}(Object(Laravel\\Lumen\\Application), Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(756): Illuminate\\Container\\Container->build(Object(Closure))\n",
          "/lumen/vendor/illuminate/container/Container.php(692): Illuminate\\Container\\Container->resolve('translator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(300): Illuminate\\Container\\Container->make('translator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(596): Laravel\\Lumen\\Application->make('translator')\n",
          "/lumen/vendor/illuminate/container/Container.php(871): Laravel\\Lumen\\Application->Laravel\\Lumen\\{closure}(Object(Laravel\\Lumen\\Application), Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(756): Illuminate\\Container\\Container->build(Object(Closure))\n",
          "/lumen/vendor/illuminate/container/Container.php(692): Illuminate\\Container\\Container->resolve('translator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(300): Illuminate\\Container\\Container->make('translator', Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(1419): Laravel\\Lumen\\Application->make('translator')\n",
          "/lumen/vendor/illuminate/validation/ValidationServiceProvider.php(32): Illuminate\\Container\\Container->offsetGet('translator')\n",
          "/lumen/vendor/illuminate/container/Container.php(871): Illuminate\\Validation\\ValidationServiceProvider->Illuminate\\Validation\\{closure}(Object(Laravel\\Lumen\\Application), Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(756): Illuminate\\Container\\Container->build(Object(Closure))\n",
          "/lumen/vendor/illuminate/container/Container.php(692): Illuminate\\Container\\Container->resolve('validator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(300): Illuminate\\Container\\Container->make('validator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(636): Laravel\\Lumen\\Application->make('validator')\n",
          "/lumen/vendor/illuminate/container/Container.php(871): Laravel\\Lumen\\Application->Laravel\\Lumen\\{closure}(Object(Laravel\\Lumen\\Application), Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(756): Illuminate\\Container\\Container->build(Object(Closure))\n",
          "/lumen/vendor/illuminate/container/Container.php(692): Illuminate\\Container\\Container->resolve('validator', Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Application.php(300): Illuminate\\Container\\Container->make('validator', Array)\n",
          "/lumen/vendor/illuminate/container/Container.php(1419): Laravel\\Lumen\\Application->make('validator')\n",
          "/lumen/vendor/illuminate/support/Facades/Facade.php(222): Illuminate\\Container\\Container->offsetGet('validator')\n",
          "/lumen/vendor/illuminate/support/Facades/Facade.php(193): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance('validator')\n",
          "/lumen/vendor/illuminate/support/Facades/Facade.php(332): Illuminate\\Support\\Facades\\Facade::getFacadeRoot()\n",
          "/lumen/app/Http/Middleware/RequestValidation/RequestValidation.php(39): Illuminate\\Support\\Facades\\Facade::__callStatic('make', Array)\n",
          "/lumen/app/Http/Middleware/RequestValidation/ApiRequestValidation.php(68): App\\Http\\Middleware\\RequestValidation\\RequestValidation->validate()\n",
          "/lumen/vendor/illuminate/pipeline/Pipeline.php(180): App\\Http\\Middleware\\RequestValidation\\ApiRequestValidation->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/illuminate/pipeline/Pipeline.php(116): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(426): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(263): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(169): Laravel\\Lumen\\Application->handleFoundRoute(Array)\n",
          "/lumen/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(48): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/app/Http/Middleware/Caching.php(80): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/illuminate/pipeline/Pipeline.php(180): App\\Http\\Middleware\\Caching->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/app/Http/Middleware/Cors.php(40): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/illuminate/pipeline/Pipeline.php(180): App\\Http\\Middleware\\Cors->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/illuminate/pipeline/Pipeline.php(116): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(426): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(175): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))\n",
          "/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(112): Laravel\\Lumen\\Application->dispatch(NULL)\n",
          "/lumen/public/index.php(28): Laravel\\Lumen\\Application->run()\n",
          "{main}"
        ]
      }
    }
  ]
}

Steps To Reproduce:

system wide

glodzienski commented 2 years ago

I was looking for information about this error in internet right now, I found nothing. Luck of me, that I found that issue.

I'm getting this error in my lumen packages and apis. And 3 days ago, it was working.

Seems like that illuminate/translation (2 days ago, https://github.com/illuminate/translation/commit/53d0cd548a8ad64eaf12d539bf39ee4189dcee56) uses getFallbackLocale method of Application lumen/laravel class. But this method does not exist in Lumen, just in Laravel.

I suggest implementing as soon as possible the getFallbackLocale method in Application class.

DavidSchmucker commented 2 years ago

Works like a charm. Thanks!