Skip to content

Commit

Permalink
fix dashboard error
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Jan 10, 2021
1 parent 77b33fc commit eecf44d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -56,7 +56,6 @@
"symfony/webpack-encore-bundle": "^1.8",
"symfony/yaml": "^5.2",
"twig/intl-extra": "^3.1",
"umpirsky/twig-php-function": "^0.2",
"vich/uploader-bundle": "^1.16",
"villfa/invert-color": "^0.5",
"wyrihaximus/html-compress": "^4.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/src/AdminRoutes.yaml
@@ -1,8 +1,8 @@
pushword_admin_dashboard:
path: /admin/dashboard
controller: Sonata\AdminBundle\Controller\CRUDController::listAction
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
defaults:
_sonata_admin: pushword.admin.page
route: admin_app_page_list

admin_area:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/Resources/config/services/all.yaml
Expand Up @@ -134,14 +134,6 @@ services:
class: DPolac\TwigLambda\LambdaExtension
tags: [{ name: twig.extension }]

pushword.twig.extension.php_function:
class: Umpirsky\Twig\Extension\PhpFunctionExtension
public: false
tags:
- { name: twig.extension }
calls:
- [allowFunction, ['str_rot13']]

pushword.twig.extension.render_attributes:
class: PiedWeb\RenderAttributes\TwigExtension
public: false
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/Twig/AppExtension.php
Expand Up @@ -92,9 +92,15 @@ public function getFunctions()
new TwigFunction('children', [$this, 'renderChildrenList'], self::options(true)),
new TwigFunction('card_children', [$this, 'renderChildrenListCard'], self::options(true)),
new TwigFunction('getPages', [$this, 'getPublishedPages'], self::options(true)),
new TwigFunction('str_rot13', [$this, 'rot13'], self::options()),
];
}

public function rot13(string $str): string
{
return str_rot13($str);
}

public function getPublishedPages(Twig $twig, $host = null, $where = [], $orderBy = [], $limit = 0)
{
return Repository::getPageRepository($this->em, $this->pageClass)->getPublishedPages($host, $where, $orderBy, $limit);
Expand Down

0 comments on commit eecf44d

Please sign in to comment.