Skip to content

Commit

Permalink
fix: add resolver and url service provder to fix Link Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrickn committed Aug 1, 2022
1 parent 37ad4a4 commit adcee6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions RoutingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Cyd293\BackendSkin;

use Cyd293\BackendSkin\Router\UrlGenerator;
use Illuminate\Support\ServiceProvider;
use October\Rain\Html\UrlServiceProvider;

class RoutingServiceProvider extends ServiceProvider
class RoutingServiceProvider extends UrlServiceProvider
{
public function register()
{
$this->registerUrlGenerator();
parent::register();
}

protected function registerUrlGenerator()
Expand All @@ -25,7 +26,11 @@ protected function registerUrlGenerator()
);

$url->setSessionResolver(function () {
return $this->app['session'];
return $this->app['session'] ?? null;
});

$url->setKeyResolver(function () {
return $this->app->make('config')->get('app.key');
});

$app->rebinding('routes', function ($app, $routes) {
Expand All @@ -43,4 +48,4 @@ protected function requestRebinder()
};
}

}
}
4 changes: 3 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- Fixes the issue in Url Generator
2.0.0:
- Compatibility for version 2 and 3
- Breaking changes! his version will not work for version 1
- Breaking changes! this version will not work for version 1
2.0.1:
- Fix where the backend skin does not fetch the custom themes
2.0.2:
- Fix issue with LINK_POLICY

0 comments on commit adcee6f

Please sign in to comment.