0

I developed custom bundle using this lesson http://blog.sulu.io/how-to-develop-a-bundle-in-the-sulu-admin-1. When dev environment is on, everything is ok, but in prod I see an empty page with left menu. Bundle's main.js console.log() is not firing. Can somebody help me?

enter image description here

Routing

//routing_api.xml
<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://friendsofsymfony.github.com/schema/rest"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://friendsofsymfony.github.com/schema/rest https://raw.github.com/FriendsOfSymfony/FOSRestBundle/master/Resources/config/schema/routing/rest_routing-1.0.xsd">
    <import id="dates" resource="Example\NewsBundle\Controller\CalendarDateController" type="rest"/>
    <import id="emails" resource="Example\NewsBundle\Controller\CalendarEmailController" type="rest"/>
    <import id="letters" resource="Example\NewsBundle\Controller\CalendarLetterController" type="rest"/>
    <import id="reserves" resource="Example\NewsBundle\Controller\CalendarReserveController" type="rest"/>
</routes>

Admin Class

//admin class
<?php

namespace Example\NewsBundle\Admin;

use Sulu\Bundle\AdminBundle\Admin\Admin;
use Sulu\Bundle\AdminBundle\Navigation\Navigation;
use Sulu\Bundle\AdminBundle\Navigation\NavigationItem;

class CalendarDateAdmin extends Admin
{
    public function __construct($title)
    {
        $rootNavigationItem = new NavigationItem($title);

        $global = new NavigationItem('navigation.modules', $rootNavigationItem);
        $news = new NavigationItem('navigation.news', $global);
        $news->setAction('example/dates');
        $news->setIcon('pencil-square-o');
        $news->setPosition(25);

        $datesPageItem = new NavigationItem('navigation.news.dates');
        $datesPageItem->setAction('example/dates');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.emails');
        $datesPageItem->setAction('example/emails');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.letters');
        $datesPageItem->setAction('example/letters');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.reserves');
        $datesPageItem->setAction('example/reserves');
        $news->addChild($datesPageItem);

        $this->setNavigation(new Navigation($rootNavigationItem));
    }

    public function getJsBundleName()
    {
        return 'examplenews';
    }
}
hitchen
  • 23
  • 4
  • clear your cache, `php bin/console cache:clear --env=prod` – Chase Apr 21 '17 at 18:37
  • Thank you, but cache:clear --env=prod is not working in this case – hitchen Apr 22 '17 at 13:15
  • Do you have something in the `Resources/public/js` folder? You probably have to trigger a build with `npm install` and `grunt build` in your bundle, otherwise these files are missing in the production environment. – Daniel Rotter Apr 30 '17 at 18:09

0 Answers0