-
Notifications
You must be signed in to change notification settings - Fork 590
Closed
Description
The method getFullUrl has an unexpected side effect, because it constructs the controller of the model which binds a different exception handler even if the request doesn't originate from twill
This is problematic as then exceptions are not rendering as expected or reported to sentry
Lines 185 to 197 in 6d02239
| public function getFullUrl(): string | |
| { | |
| if (! method_exists($this, 'getSlug')) { | |
| return '#'; | |
| } | |
| // @phpstan-ignore-next-line | |
| if (method_exists($this, 'getUrlWithoutSlug') && $this->urlWithoutSlug) { | |
| return rtrim($this->urlWithoutSlug, '/') . '/' . $this->getSlug(); | |
| } | |
| try { | |
| $controller = getModelController($this); |
twill/src/Http/Controllers/Admin/Controller.php
Lines 20 to 25 in 6d02239
| public function __construct() | |
| { | |
| if (Config::get('twill.bind_exception_handler', true)) { | |
| App::singleton(ExceptionHandler::class, TwillHandler::class); | |
| } |
(And yes I spent 3 hours trying to figure out why my 404 pages were rendering like this in production
instead of with my custom view, long story short I have a menu that uses a Page model and gets the url of those pages using getFullUrl)
Metadata
Metadata
Assignees
Labels
No labels