odiseoteam / OdiseoBlogBundle

This Bundle add blog capabilities to your Symfony project. It is admin agnostic, so you need to integrate on your preferred admin system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

You have requested a non-existent parameter "odiseo_blog.model.article.class".

HecFranco opened this issue · comments

I started a new project in symfony 4 with this bundle installed and after following the configuration I get this error.

You have requested a non-existent parameter "odiseo_blog.model.article.class".

# services.yaml
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    google_recaptcha_site_key: '%env(GOOGLE_RECAPTCHA_SITE_KEY)%'
    locale: 'es'

imports:
    - { resource: "@OdiseoBlogBundle/Resources/config/config.yml" }    
services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

Hi @HecFranco , you need to add the plugin in AppKernel (bundles.php) before the SyliusResource one. Did you do that?
Let me know if that solve the issue. Also feel free to contact me at Sylius Slack: http://sylius-devs.slack.com/team/U3FR368UC.

Hi @HecFranco , you need to add the plugin in AppKernel (bundles.php) before the SyliusResource one. Did you do that?
Let me know if that solve the issue. Also feel free to contact me at Sylius Slack: http://sylius-devs.slack.com/team/U3FR368UC.

My bundles.php is this:

<?php
return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
    EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class => ['all' => true],
    Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
    Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
    JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
    Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],
    Odiseo\BlogBundle\OdiseoBlogBundle::class => ['all' => true],
    Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
    Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
    FOS\RestBundle\FOSRestBundle::class => ['all' => true],
    FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
    Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
];

I think it's the right one.

I try to get into the slack group but I don't get it.

So strange then because it not happens to me. Another solution can be configuring that parameter for yourself, like this:

parameters:
    odiseo_blog.model.article.class: Odiseo\BlogBundle\Model\Article

Or your Article FQDN of your class if your are extending it.

If the error persist maybe you can add me to hangouts, my email is diego@odiseo.com.ar.

same issue happened to me and had to add

parameters:
    odiseo_blog.model.article.class: Odiseo\BlogBundle\Model\Article
    odiseo_blog.model.article_category.class: Odiseo\BlogBundle\Model\ArticleCategory
    odiseo_blog.model.article_comment.class: Odiseo\BlogBundle\Model\ArticleComment

parameters:
odiseo_blog.model.article.class: Odiseo\BlogBundle\Model\Article
odiseo_blog.model.article_category.class: Odiseo\BlogBundle\Model\ArticleCategory
odiseo_blog.model.article_comment.class: Odiseo\BlogBundle\Model\ArticleComment

Be aware, if you're using SyliusBlogPlugin, you must use the entity from the SyliusBlogPlugin and not the ones from BlogBundle.

Like this :

parameters:
    odiseo_blog.model.article.class: Odiseo\SyliusBlogPlugin\Entity\Article
    odiseo_blog.model.article_category.class: Odiseo\BlogBundle\Model\ArticleCategory
    odiseo_blog.model.article_comment.class: Odiseo\SyliusBlogPlugin\Entity\ArticleComment

Hello,
I did like that, if that helps.

Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Odiseo\BlogBundle\OdiseoBlogBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class => ['all' => true],
Odiseo\SyliusBlogPlugin\OdiseoSyliusBlogPlugin::class => ['all' => true],