When preferred language of the user logged in is other than 'en' get ErrorException editing users profiles #420

Closed
opened 2026-02-04 19:44:25 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @leomartinez on GitHub (Aug 29, 2017).

Bug Report

Scenario

  • Preferred language of the user trying to edit profile is other than en

  • Operating System: Debian 9

  • BookStack Version: 0.17.4

  • PHP Version: 7.0.19-1

  • MySQL Version: Ver 14.14 Distrib 5.7.19

Expected Behavior

Display Edit Profile page to change own profile (or other users profiles as admin)

Actual Behavior

Get 2 ErrorExceptions:

First ErrorException:
Invalid argument supplied for foreach() (View: /var/local/BookStack/resources/views/users/edit.blade.php)

/var/local/BookStack/storage/framework/views/9b36ec83aeea5f7cb4e3aabc88d24e15ce0c29eb.php#45
Second ErrorException:
Invalid argument supplied for foreach()

/var/local/BookStack/storage/framework/views/9b36ec83aeea5f7cb4e3aabc88d24e15ce0c29eb.php#45
Originally created by @leomartinez on GitHub (Aug 29, 2017). ### Bug Report #### Scenario * Preferred language of the user trying to edit profile is other than **`en`** * Operating System: **Debian 9** * BookStack Version: **0.17.4** * PHP Version: **7.0.19-1** * MySQL Version: **Ver 14.14 Distrib 5.7.19** ##### Expected Behavior Display Edit Profile page to change own profile (or other users profiles as admin) ##### Actual Behavior Get 2 ErrorExceptions: ###### First ErrorException: ``` Invalid argument supplied for foreach() (View: /var/local/BookStack/resources/views/users/edit.blade.php) /var/local/BookStack/storage/framework/views/9b36ec83aeea5f7cb4e3aabc88d24e15ce0c29eb.php#45 ``` ###### Second ErrorException: ``` Invalid argument supplied for foreach() /var/local/BookStack/storage/framework/views/9b36ec83aeea5f7cb4e3aabc88d24e15ce0c29eb.php#45 ```
OVERLORD added the 🐛 Bug label 2026-02-04 19:44:25 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 9, 2017):

@leomartinez Thanks for submitting an issue. I'm having trouble replicate this one. Would you be able to provide some very clear steps which always replicate the issue?

@ssddanbrown commented on GitHub (Sep 9, 2017): @leomartinez Thanks for submitting an issue. I'm having trouble replicate this one. Would you be able to provide some very clear steps which always replicate the issue?
Author
Owner

@nekromoff commented on GitHub (Sep 16, 2017):

I can confirm this.


Whoops, looks like something went wrong.
2/2 ErrorException in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45: Invalid argument supplied for foreach() (View: /var/www/html/bookstack/resources/views/users/edit.blade.php)

    in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45
    at CompilerEngine->handleViewException(object(ErrorException), 1) in PhpEngine.php line 44
    at PhpEngine->evaluatePath('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in CompilerEngine.php line 59
    at CompilerEngine->get('/var/www/html/bookstack/resources/views/users/edit.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in View.php line 137
    at View->getContents() in View.php line 120
    at View->renderContents() in View.php line 85
    at View->render() in Response.php line 38
    at Response->setContent(object(View)) in Response.php line 225
    at Response->__construct(object(View)) in Router.php line 602
    at Router->prepareResponse(object(Request), object(View)) in Router.php line 559
    at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Controller.php line 44
    at Controller->BookStack\Http\Controllers\{closure}(object(Request), object(Closure)) in Pipeline.php line 131
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 45
    at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Localization.php line 31
    at Localization->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
    at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
    at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Router.php line 561
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
    at Router->dispatchToRoute(object(Request)) in Router.php line 498
    at Router->dispatch(object(Request)) in Kernel.php line 174
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
    at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
    at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
    at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
    at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Kernel.php line 149
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
    at Kernel->handle(object(Request)) in index.php line 53

1/2 ErrorException in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45: Invalid argument supplied for foreach()

    in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45
    at HandleExceptions->handleError(2, 'Invalid argument supplied for foreach()', '/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', 45, array('__path' => '/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', '__data' => array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection)), 'obLevel' => 1, '__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection), '__currentLoopData' => 'settings.language_select')) in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45
    at include('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php') in PhpEngine.php line 42
    at PhpEngine->evaluatePath('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in CompilerEngine.php line 59
    at CompilerEngine->get('/var/www/html/bookstack/resources/views/users/edit.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in View.php line 137
    at View->getContents() in View.php line 120
    at View->renderContents() in View.php line 85
    at View->render() in Response.php line 38
    at Response->setContent(object(View)) in Response.php line 225
    at Response->__construct(object(View)) in Router.php line 602
    at Router->prepareResponse(object(Request), object(View)) in Router.php line 559
    at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Controller.php line 44
    at Controller->BookStack\Http\Controllers\{closure}(object(Request), object(Closure)) in Pipeline.php line 131
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 45
    at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Localization.php line 31
    at Localization->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
    at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
    at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Router.php line 561
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
    at Router->dispatchToRoute(object(Request)) in Router.php line 498
    at Router->dispatch(object(Request)) in Kernel.php line 174
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
    at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
    at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
    at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
    at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Kernel.php line 149
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
    at Kernel->handle(object(Request)) in index.php line 53
@nekromoff commented on GitHub (Sep 16, 2017): I can confirm this. ``` Whoops, looks like something went wrong. 2/2 ErrorException in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45: Invalid argument supplied for foreach() (View: /var/www/html/bookstack/resources/views/users/edit.blade.php) in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45 at CompilerEngine->handleViewException(object(ErrorException), 1) in PhpEngine.php line 44 at PhpEngine->evaluatePath('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in CompilerEngine.php line 59 at CompilerEngine->get('/var/www/html/bookstack/resources/views/users/edit.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in View.php line 137 at View->getContents() in View.php line 120 at View->renderContents() in View.php line 85 at View->render() in Response.php line 38 at Response->setContent(object(View)) in Response.php line 225 at Response->__construct(object(View)) in Router.php line 602 at Router->prepareResponse(object(Request), object(View)) in Router.php line 559 at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Controller.php line 44 at Controller->BookStack\Http\Controllers\{closure}(object(Request), object(Closure)) in Pipeline.php line 131 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 45 at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Localization.php line 31 at Localization->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51 at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 53 1/2 ErrorException in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45: Invalid argument supplied for foreach() in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45 at HandleExceptions->handleError(2, 'Invalid argument supplied for foreach()', '/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', 45, array('__path' => '/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', '__data' => array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection)), 'obLevel' => 1, '__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection), '__currentLoopData' => 'settings.language_select')) in ca3a5720241b5014b6c603415dc23eddd2981b06.php line 45 at include('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php') in PhpEngine.php line 42 at PhpEngine->evaluatePath('/var/www/html/bookstack/storage/framework/views/ca3a5720241b5014b6c603415dc23eddd2981b06.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in CompilerEngine.php line 59 at CompilerEngine->get('/var/www/html/bookstack/resources/views/users/edit.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'signedIn' => true, 'currentUser' => object(User), 'pageTitle' => 'Profil používateľa', 'user' => object(User), 'activeSocialDrivers' => array('google' => 'Google'), 'authMethod' => 'standard', 'roles' => object(Collection))) in View.php line 137 at View->getContents() in View.php line 120 at View->renderContents() in View.php line 85 at View->render() in Response.php line 38 at Response->setContent(object(View)) in Response.php line 225 at Response->__construct(object(View)) in Router.php line 602 at Router->prepareResponse(object(Request), object(View)) in Router.php line 559 at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Controller.php line 44 at Controller->BookStack\Http\Controllers\{closure}(object(Request), object(Closure)) in Pipeline.php line 131 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 45 at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Localization.php line 31 at Localization->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51 at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 53 ```
Author
Owner

@nekromoff commented on GitHub (Sep 16, 2017):

Clearly, if the used translation (in my case SK) is not complete, then this error is thrown.

In this case settings.language_select array key is missing from lang/sk/settings.php file.

@nekromoff commented on GitHub (Sep 16, 2017): Clearly, if the used translation (in my case SK) is not complete, then this error is thrown. In this case `settings.language_select` array key is missing from `lang/sk/settings.php` file.
Author
Owner

@nekromoff commented on GitHub (Sep 16, 2017):

When this is copied/appended to the localized translations (lang/../settings.php):

'language_select' => [
        'en' => 'English',
        'de' => 'Deutsch',
        'es' => 'Español',
        'fr' => 'Français',
        'nl' => 'Nederlands',
        'pt_BR' => 'Português do Brasil',
        'sk' => 'Slovensky',
        'ja' => '日本語',
        'pl' => 'Polski',
    ]

everything works as expected.

@nekromoff commented on GitHub (Sep 16, 2017): When this is copied/appended to the localized translations (`lang/../settings.php`): ``` 'language_select' => [ 'en' => 'English', 'de' => 'Deutsch', 'es' => 'Español', 'fr' => 'Français', 'nl' => 'Nederlands', 'pt_BR' => 'Português do Brasil', 'sk' => 'Slovensky', 'ja' => '日本語', 'pl' => 'Polski', ] ``` everything works as expected.
Author
Owner

@ssddanbrown commented on GitHub (Sep 17, 2017):

Still cannot reproduce this. I go to my profile, Change my language, and every works as expected. No error.

Please confirm your APP_LANG variable in your .env file. Also confirm what language causes the error. Also please confirm if you've changed any of the files in the config directory.

Could also try running sudo php artisan views:clear from the BookStack folder to see if things work after that.

@nekromoff The values set in EN should act as a backup when a language is missing translations so a non-en language missing the language_select key should not be a problem.

@ssddanbrown commented on GitHub (Sep 17, 2017): Still cannot reproduce this. I go to my profile, Change my language, and every works as expected. No error. Please confirm your `APP_LANG` variable in your `.env` file. Also confirm what language causes the error. Also please confirm if you've changed any of the files in the `config` directory. Could also try running `sudo php artisan views:clear` from the BookStack folder to see if things work after that. @nekromoff The values set in `EN` should act as a backup when a language is missing translations so a non-en language missing the `language_select` key should not be a problem.
Author
Owner

@nekromoff commented on GitHub (Sep 18, 2017):

APP_LANG=sk in .env

config/app.php:

    /*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by the translation service provider. You are free to set this value
    | to any of the locales which will be supported by the application.
    |
     */

    'locale' => env('APP_LANG', 'sk'),
    'locales' => ['en', 'de', 'es', 'fr', 'nl', 'pt_BR', 'sk', 'ja', 'pl'],

    /*
    |--------------------------------------------------------------------------
    | Application Fallback Locale
    |--------------------------------------------------------------------------
    |
    | The fallback locale determines the locale to use when the current one
    | is not available. You may change the value to correspond to any of
    | the language folders that are provided through your application.
    |
     */

    'fallback_locale' => 'sk',

I guess when my language was not changing, I must have changed the fallback to sk and that's why it was not finding that array? If yes, please close this issue.

(However, language should be changed on its change in user profile, not on next login - this is important from the UX point of view and will prevent further confusion regarding language setup)

@nekromoff commented on GitHub (Sep 18, 2017): `APP_LANG=sk` in .env config/app.php: ``` /* |-------------------------------------------------------------------------- | Application Locale Configuration |-------------------------------------------------------------------------- | | The application locale determines the default locale that will be used | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | */ 'locale' => env('APP_LANG', 'sk'), 'locales' => ['en', 'de', 'es', 'fr', 'nl', 'pt_BR', 'sk', 'ja', 'pl'], /* |-------------------------------------------------------------------------- | Application Fallback Locale |-------------------------------------------------------------------------- | | The fallback locale determines the locale to use when the current one | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | */ 'fallback_locale' => 'sk', ``` I guess when my language was not changing, I must have changed the fallback to sk and that's why it was not finding that array? If yes, please close this issue. (However, language should be changed on its change in user profile, not on next login - this is important from the UX point of view and will prevent further confusion regarding language setup)
Author
Owner

@leomartinez commented on GitHub (Sep 18, 2017):

The issue apears when changing 'fallback_locale' to other language than 'en'. As @ssddanbrown said, this is a backup option when a language is missing translations.

Agreed with @nekromoff that language change should be applied when the profile is saved. This would improve the UX.

This issue should be closed.

@leomartinez commented on GitHub (Sep 18, 2017): The issue apears when changing `'fallback_locale'` to other language than `'en'`. As @ssddanbrown said, this is a backup option when a language is missing translations. Agreed with @nekromoff that language change should be applied when the profile is saved. This would improve the UX. This issue should be closed.
Author
Owner

@ssddanbrown commented on GitHub (Sep 18, 2017):

Okay, I will go ahead and close this issue. The language should change right away upon profile save.

It does in my testing and there's nothing to change this upon login/logout. Changing language in .env can sometimes be delayed if you've cached your config at any point.

@ssddanbrown commented on GitHub (Sep 18, 2017): Okay, I will go ahead and close this issue. The language should change right away upon profile save. It does in my testing and there's nothing to change this upon login/logout. Changing language in `.env` can sometimes be delayed if you've cached your config at any point.
Author
Owner

@nekromoff commented on GitHub (Sep 18, 2017):

Maybe forcing cache clear for views on language change in user profile?

On Mon, Sep 18, 2017 at 3:33 PM, Dan Brown notifications@github.com wrote:

Okay, I will go ahead and close this issue. The language should change
right away upon profile save.

It does in my testing and there's nothing to change this upon
login/logout. Changing language in .env can sometimes be delayed if
you've cached your config at any point.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/BookStackApp/BookStack/issues/491#issuecomment-330221947,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIJ3zUKGzc8_UHX5fPt2ORlMvBC7Yb2wks5sjnEQgaJpZM4PF7DP
.

@nekromoff commented on GitHub (Sep 18, 2017): Maybe forcing cache clear for views on language change in user profile? On Mon, Sep 18, 2017 at 3:33 PM, Dan Brown <notifications@github.com> wrote: > Okay, I will go ahead and close this issue. The language should change > right away upon profile save. > > It does in my testing and there's nothing to change this upon > login/logout. Changing language in .env can sometimes be delayed if > you've cached your config at any point. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/BookStackApp/BookStack/issues/491#issuecomment-330221947>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AIJ3zUKGzc8_UHX5fPt2ORlMvBC7Yb2wks5sjnEQgaJpZM4PF7DP> > . >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#420