lukasbestle / kirby-versions

Keep track of content changes and switch between different versions from the Kirby 3 Panel
MIT License
77 stars 4 forks source link

Kirby 3.6 - Internal error in the Versions plugin (error code user-not-logged-in) #7

Closed raphaelsaunier closed 2 years ago

raphaelsaunier commented 2 years ago

Describe the bug

After upgrading to the latest version of Kirby (3.6.1.1) and the latest version of this plugin (1.0.1) , it is impossible to open the panel as a logged out user.

No exception is thrown for a user who is already authenticated.

Steps to reproduce

  1. Go to https://example.com/panel
  2. See the following error:
Kirby\Exception\LogicException thrown with message "Internal error in the Versions plugin (error code user-not-logged-in)"

Stacktrace:
#12 Kirby\Exception\LogicException in /Users/raphaelsaunier/code/project-name/site/plugins/versions/src/classes/Plugin.php:180
#11 LukasBestle\Versions\Plugin:hasPermission in /Users/raphaelsaunier/code/project-name/site/plugins/versions/src/config/areas.php:7
#10 Kirby\Filesystem\F:{closure} in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Cms/Loader.php:170
#9 Kirby\Cms\Loader:resolve in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Cms/Loader.php:92
#8 Kirby\Cms\Loader:areas in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Panel/Panel.php:61
#7 Kirby\Panel\Panel:areas in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Panel/Panel.php:302
#6 Kirby\Panel\Panel:router in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/config/routes.php:101
#5 Kirby\Http\Route:{closure} in [internal]:0
#4 Closure:call in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Http/Router.php:111
#3 Kirby\Http\Router:call in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Cms/App.php:345
#2 Kirby\Cms\App:call in /Users/raphaelsaunier/code/project-name/vendor/getkirby/cms/src/Cms/App.php:1086
#1 Kirby\Cms\App:render in /Users/raphaelsaunier/code/project-name/index.php:9
#0 require in /Users/raphaelsaunier/.composer/vendor/laravel/valet/server.php:211

Expected behavior

I should be able to at least log in. 😅

Additional context

image

Technical details

lukasbestle commented 2 years ago

Sorry, that's a pretty obvious bug. 😅

I'll fix it ASAP.

raphaelsaunier commented 2 years ago

No worries man! Thanks for all the time you put into this useful plugin. 🙏

After using it for a couple of months I noticed some other rough edges; if I find the time I'll try to contribute or at least open a couple of issues.

lukasbestle commented 2 years ago

Fixed in a new plugin release 1.0.2, which also comes with some other minor enhancements. :)