tastyigniter / TastyIgniter

:fire: Powerful, yet easy to use, open-source online ordering, table reservation and management system for restaurants
https://tastyigniter.com
MIT License
3.03k stars 994 forks source link

[BUG] Non-admin users cannot access locations that are disabled #652

Closed djtimca closed 3 years ago

djtimca commented 3 years ago

Expected behavior: For a user with access to a single location they should be able to access the restaurant settings page (with appropriate permissions).

For a user with multiple assigned locations they should be able to access settings for all their assigned locations.

Actual behavior: Single location access users get the following error when they go to settings:

"Form record with ID [3] could not be found." on line 91 of /home/dineniag/public_html/app/admin/traits/FormExtendable.php#0 [internal function]: Admin\Actions\FormController->formFindModelObject(3)
#1 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Traits/ExtendableTrait.php(428): call_user_func_array(Array, Array)
#2 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Support/Extendable.php(42): Igniter\Flame\Support\Extendable->extendableCall('formFindModelOb...', Array)
#3 /home/dineniag/public_html/app/admin/actions/FormController.php(281): Igniter\Flame\Support\Extendable->__call('formFindModelOb...', Array)
#4 /home/dineniag/public_html/app/admin/controllers/Locations.php(74): Admin\Actions\FormController->edit('edit', 3)
#5 [internal function]: Admin\Controllers\Locations->settings('settings')
#6 /home/dineniag/public_html/app/admin/classes/AdminController.php(206): call_user_func_array(Array, Array)
#7 /home/dineniag/public_html/app/admin/classes/AdminController.php(172): Admin\Classes\AdminController->execPageAction('settings', Array)
#8 /home/dineniag/public_html/app/admin/controllers/Locations.php(66): Admin\Classes\AdminController->remap('settings', Array)
#9 /home/dineniag/public_html/app/system/classes/Controller.php(106): Admin\Controllers\Locations->remap('settings', Array)
#10 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): System\Classes\Controller->runAdmin('locations/setti...')
#11 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('runAdmin', Array)
#12 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(System\Classes\Controller), 'runAdmin')
#13 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#14 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#15 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#16 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Currency/Middleware/CurrencyMiddleware.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Currency\Middleware\CurrencyMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Translation/Middleware/Localization.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Translation\Middleware\Localization->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#24 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#34 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#35 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#36 /home/dineniag/public_html/vendor/october/rain/src/Router/CoreRouter.php(20): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#37 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): October\Rain\Router\CoreRouter->dispatch(Object(Illuminate\Http\Request))
#38 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#39 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Setting/Middleware/SaveSetting.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Setting\Middleware\SaveSetting->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /home/dineniag/public_html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#44 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#48 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#49 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#51 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#52 /home/dineniag/public_html/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#53 {main}

Users with multiple location access get a blank list when they access the Locations page.

Reproduce steps: Upgraded to version v3.0.4-beta.26 and this exists.

Version: v3.0.4-beta.26

Additional Information: Error from the system logs also appears:

BadMethodCallException: Call to undefined method Admin\Models\Locations_model::tables()
in /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50
Stack trace:
#0 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException('tables')
#1 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1622): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Igniter\Flame\Database\Builder), 'tables', Array)
#2 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Traits/ExtendableTrait.php(442): Illuminate\Database\Eloquent\Model->__call('tables', Array)
#3 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Database/Model.php(698): Igniter\Flame\Database\Model->extendableCall('tables', Array)
#4 /home/dineniag/public_html/app/admin/models/Locations_model.php(128): Igniter\Flame\Database\Model->__call('tables', Array)
#5 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Database/Model.php(161): Admin\Models\Locations_model->beforeDelete()
#6 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(369): Igniter\Flame\Database\Model->Igniter\Flame\Database\{closure}(Object(Admin\Models\Locations_model))
#7 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(218): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('eloquent.deleti...', Array)
#8 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(191): Illuminate\Events\Dispatcher->dispatch('eloquent.deleti...', Array, true)
#9 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(189): Illuminate\Events\Dispatcher->until('eloquent.deleti...', Object(Admin\Models\Locations_model))
#10 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(898): Illuminate\Database\Eloquent\Model->fireModelEvent('deleting')
#11 /home/dineniag/public_html/app/admin/actions/ListController.php(131): Illuminate\Database\Eloquent\Model->delete()
#12 [internal function]: Admin\Actions\ListController->index_onDelete('index')
#13 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Traits/ExtendableTrait.php(428): call_user_func_array(Array, Array)
#14 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Support/Extendable.php(42): Igniter\Flame\Support\Extendable->extendableCall('index_onDelete', Array)
#15 [internal function]: Igniter\Flame\Support\Extendable->__call('index_onDelete', Array)
#16 /home/dineniag/public_html/app/admin/classes/AdminController.php(405): call_user_func_array(Array, Array)
#17 /home/dineniag/public_html/app/admin/classes/AdminController.php(262): Admin\Classes\AdminController->runHandler('onDelete', Array)
#18 /home/dineniag/public_html/app/admin/classes/AdminController.php(167): Admin\Classes\AdminController->processHandlers()
#19 /home/dineniag/public_html/app/admin/controllers/Locations.php(66): Admin\Classes\AdminController->remap('index', Array)
#20 /home/dineniag/public_html/app/system/classes/Controller.php(106): Admin\Controllers\Locations->remap('index', Array)
#21 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): System\Classes\Controller->runAdmin('locations')
#22 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('runAdmin', Array)
#23 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(System\Classes\Controller), 'runAdmin')
#24 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#25 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#26 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Currency/Middleware/CurrencyMiddleware.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Currency\Middleware\CurrencyMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Translation/Middleware/Localization.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Translation\Middleware\Localization->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#44 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#45 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#46 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#47 /home/dineniag/public_html/vendor/october/rain/src/Router/CoreRouter.php(20): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#48 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): October\Rain\Router\CoreRouter->dispatch(Object(Illuminate\Http\Request))
#49 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#50 /home/dineniag/public_html/vendor/tastyigniter/flame/src/Setting/Middleware/SaveSetting.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Igniter\Flame\Setting\Middleware\SaveSetting->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 /home/dineniag/public_html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#57 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#58 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#59 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#60 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#61 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#62 /home/dineniag/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#63 /home/dineniag/public_html/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#64 {main}
djtimca commented 3 years ago

The issue appears only to affect users who have restricted locations and where the location is disabled. If the location is enabled the error does not exist

sampoyigi commented 3 years ago

Tracking back on this, do we really want to grant a restricted user access to a disabled location?

djtimca commented 3 years ago

In my use case I have multiple restaurants with different owners being set up. When we set up their account we grant access to the location only. I want their location to remain disabled and not visible until they have completed setup of their menus etc and are ready to launch on the platform.

If I want to restrict their access to the platform I do it either through removing access to a specific location or by disabling their login altogether.

Each "location owner" though needs the ability to disable and reenable their location as required for their own operations.

sampoyigi commented 3 years ago

You make a good point! I'll merge the PR.