From 4173cd4a10dfb37d60ad827e72c39ff24884fa3e Mon Sep 17 00:00:00 2001 From: Aaron Valandra Date: Tue, 6 Dec 2016 09:59:36 -0600 Subject: [PATCH] Hotfix for adding the appropriate directives and handlers after a recent core update in Bolt. --- src/Provider/APIProvider.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Provider/APIProvider.php b/src/Provider/APIProvider.php index fd05a10..1227566 100644 --- a/src/Provider/APIProvider.php +++ b/src/Provider/APIProvider.php @@ -14,6 +14,8 @@ use Bolt\Extension\Bolt\JsonApi\Storage\Query\Handler\PagingHandler; use Silex\Application; use Silex\ServiceProviderInterface; +use Bolt\Storage\Query\ContentQueryParser; + /** * Class APIProvider @@ -152,9 +154,13 @@ function ($classMetadata) use ($app) { } ); - $app['query.parser']->addDirectiveHandler('paginate', new PagerHandler()); - $app['query.parser']->addHandler('pager', new PagingHandler()); - $app['query.parser']->addOperation('pager'); + $app->extend('query.parser', function (ContentQueryParser $parser) { + $parser->addDirectiveHandler('paginate', new PagerHandler()); + $parser->addHandler('pager', new PagingHandler()); + $parser->addOperation('pager'); + + return $parser; + }); } /**