2017-03-24 58 views
0

我有一個CampusCalendarBundle擴展名。在我添加DependencyInjection文件夾後加載配置文件。我有這個錯誤。我不認爲system_configuration.yml已被加載。加載服務配置時出錯

[RuntimeException] 
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]                            

The system configuration variable "oro_calendar.calendar_colors" is not 
defined. Please make sure that it is either added to bundle 
configuration settings or marked as "ui_only" in config.  

enter image description here

<?php 

namespace CampusCRM\CampusCalendarBundle\DependencyInjection; 

use Symfony\Component\DependencyInjection\ContainerBuilder; 
use Symfony\Component\Config\FileLocator; 
use Symfony\Component\HttpKernel\DependencyInjection\Extension; 
use Symfony\Component\DependencyInjection\Loader; 

class CampusCalendarExtension extends Extension 
{ 
    /** 
    * {@inheritDoc} 
    */ 
    public function load(array $configs, ContainerBuilder $container) 
    { 
     $configuration = new Configuration(); 
     $config = $this->processConfiguration($configuration, $configs); 

     $container->setParameter(
      'oro_calendar.enabled_system_calendar', 
      $config['enabled_system_calendar'] 
     ); 

     $container->prependExtensionConfig($this->getAlias(), array_intersect_key($config, array_flip(['settings']))); 

     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 
     $loader->load('services.yml'); 
     $loader->load('form.yml'); 
    } 
} 

這裏是擴展束。

<?php 

// src/CampusCRM/CampusCalendarBundle/CampusCalendarBundle.php 
namespace CampusCRM\CampusCalendarBundle; 

use Symfony\Component\HttpKernel\Bundle\Bundle; 

class CampusCalendarBundle extends Bundle 
{ 
    public function getParent() 
    { 
     return 'OroCalendarBundle'; 
    } 
} 
+0

你應該提供這個Bundle Extension的鏈接,也許對我們更好。 –

+1

迴應您以前的問題評論,你可能會得到幫助! –

+0

對不起,我不確定Bundle Extension提供什麼。 'CampusCalendarBundle'擴展'OroCalendarBundle'。你想看看'OroCalendarBundle'嗎?這裏是[OroCalendarBundle]的鏈接(https://github.com/orocrm/OroCalendarBundle) –

回答

0

我發現了一個解決方案!我可能不小心刪除了OroCalendarBundle中的一些代碼。一切正常後,我用刷新安裝替換OroCalendarBundle

謝謝大家的幫助〜

相關問題