Closed distantnative closed 2 years ago
hi, any news on this issue? would be awesome to have bouncer working with 3.6!
Hi Nico,
Apologies for the delay in addressing this. Thanks a lot for taking the time to identify the issue and pointing me in those directions! This sounds great and I also feel that it will allow to come up with a much simpler setup.
Although for now, I don't get how to trigger a redirect from the hook. As a first test, I've tried using Panel::go('...')
but without success:
'hooks' => [
'panel.route:before' => function($route, $path, $method) {
if($path != 'pages/annotator') {
Panel::go('pages/annotator');
}
}
]
Ends up with an error on click anywhere when I'm already on this page (popup shows: "The $view could not be loaded"), and this screen anytime else:
As a comparison, it redirects with the simple go('panel/...')
, but of course without the proper routing stuff / language code / etc that should happen.
Am I overlooking something? I've just started to dig into this so I might be missing something obvious, I'll keep looking but in the meantime if you have any advice, I'd gladly take them :)
Indeed, I think we would need to move this https://github.com/getkirby/kirby/blob/main/src/Panel/Panel.php#L305-L312 inside the try-catch block that follows. Could you try if that would work for you?
Awesome, it does!
Let's see if we can get it in 3.6.1 https://github.com/getkirby/kirby/pull/3964
Awesome! I'll get working on the plugin based on this.
Seems like it's good to go on the next
branch, when 3.6.1 rolls out :)
Awesome
Hi Sylvain,
As you can see from he alpha version of 3.6.0 (https://getkirby.com/releases/3.6), we will remove
vue-router
with this release. Which of course means that your plugin's functionality would be rendered broken.However, in anticipation we added two hooks
I would believe that with the
panel.route:before
hook, we could recreate your plugin. Likely even much simpler than the current setup. Let me know your thoughts - happy to collaborate.