I'm trying to just display a list. A list of my suppliers and properties was displayed until I completed the list of products :(
Now I get this error in the lists of suppliers and properties, but not for the recently added list of products:

Here is my /config.yml application:
imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } parameters: sylius.locale: "%locale%" framework: #esi: ~ translator: { fallbacks: ["%locale%"] } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~ csrf_protection: ~ validation: { enable_annotations: true } templating: engines: ['twig'] #assets_version: SomeVersionScheme default_locale: "%locale%" trusted_hosts: ~ trusted_proxies: ~ session: storage_id: session.storage.php_bridge # handler_id set to null will use default session handler from php.ini handler_id: ~ fragments: ~ http_method_override: true # Twig Configuration twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" form: resources: - 'SonataCoreBundle:Form:datepicker.html.twig' # Assetic Configuration assetic: debug: "%kernel.debug%" use_controller: false #java: /usr/bin/java node: /usr/bin/node node_paths: [ /usr/lib/node_modules, %kernel.root_dir%/../node_modules ] filters: autoprefixer: bin: %kernel.root_dir%/../node_modules/autoprefixer/autoprefixer cssrewrite: ~ less: apply_to: "\.less$" bin: %kernel.root_dir%/../node_modules/less uglifycss: bin: %kernel.root_dir%/../node_modules/uglifycss uglifyjs: bin: %kernel.root_dir%/../node_modules/uglifyjs #closure: # jar: "%kernel.root_dir%/Resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar" # Doctrine Configuration doctrine: dbal: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 mapping_types: enum: string orm: auto_generate_proxy_classes: "%kernel.debug%" entity_managers: default: connection: default auto_mapping: true dql: string_functions: HS_CONCAT_ADDRESS: AppBundle\DQL\HSConcatAddress # Swiftmailer Configuration swiftmailer: transport: "%mailer_transport%" host: "%mailer_host%" username: "%mailer_user%" password: "%mailer_password%" spool: { type: memory } # FOS UserBundle Configuration fos_user: registration: form: type: hs_user_registration db_driver: orm firewall_name: main user_class: AppBundle\Entity\User service: user_manager: app.security.user_manager # Doctrine migration bundle Configuration doctrine_migrations: dir_name: %kernel.root_dir%/DoctrineMigrations namespace: Application\Migrations table_name: migration_versions name: Application Migrations # Sonata Admin Configuration sonata_admin: options: use_select2: false # disable select2 title: App title_logo: bundles/sonataadmin/logo_title.png # Override default template templates: show: AppBundle:Admin/Backend:show.html.twig edit: AppBundle:Admin/Backend:edit.html.twig layout: AppBundle:Common/Admin:standard_layout.html.twig security: # handler: sonata.admin.security.handler.role #sonata_intl: # timezone: # locales: # en_GB: Europe/London # default: Europe/London # Sonata Block Configuration sonata_block: default_contexts: [cms] blocks: sonata.user.block.menu: # used to display the menu in profile pages sonata.user.block.account: # used to display menu option (login option) sonata.admin.block.admin_list: contexts: [admin] sonata.admin.block.search_result: contexts: [admin] knp_menu: # use "twig: false" to disable the Twig extension and the TwigRenderer twig: template: knp_menu.html.twig # if true, enables the helper for PHP templates templating: false # the renderer to use, list is also available by default default_renderer: twig # STOF Doctrine Extensions Configuration stof_doctrine_extensions: default_locale: %locale% orm: default: translatable: true sluggable: true timestampable: true a2lix_translation_form: locale_provider: default # [1] locales: ["%locale%"] # [1-a] default_locale: "%locale%" # [1-b] manager_registry: doctrine # [2] # Sylius Archetype sylius_archetype: classes: product: subject: Sylius\Component\Product\Model\Product attribute: Sylius\Component\Product\Model\Attribute option: Sylius\Component\Product\Model\Option archetype: model: Sylius\Component\Product\Model\Archetype repository: Sylius\Bundle\ResourceBundle\Doctrine\ORM\TranslatableEntityRepository translatable: targetEntity: Sylius\Component\Product\Model\ArchetypeTranslation archetype_translation: model: Sylius\Component\Product\Model\ArchetypeTranslation sylius_product: driver: doctrine/orm classes: product: model: AppBundle\Entity\Product controller: AppBundle\Controller\Backend\ProductController form: default: AppBundle\Form\Type\ProductType translatable: targetEntity: AppBundle\Entity\ProductTranslation product_translation: model: AppBundle\Entity\ProductTranslation form: default: AppBundle\Form\Type\ProductTranslationType #sylius_resource: # resources: # app.backend: # driver: doctrine/orm # object_manager: default # classes: # controller: AppBundle\Controller\Backend\ResourceController # model: AppBundle\Entity\Product # Sylius Attribute sylius_attribute: driver: doctrine/orm # Sylius Locale sylius_locale: driver: doctrine/orm # Sylius Translation sylius_translation: default_mapping: translatable: field: translations currentLocale: currentLocale fallbackLocale: fallbackLocale translation: field: translatable locale: locale # Sylius Variation sylius_variation: driver: doctrine/orm classes: product: variant: model: AppBundle\Entity\ProductVariant form: AppBundle\Form\Type\ProductVariantType
My admin class:
namespace AppBundle\Admin; use Sonata\AdminBundle\Admin\Admin; use Sonata\AdminBundle\Form\FormMapper; use Symfony\Component\EventDispatcher\Event; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Show\ShowMapper; use Sonata\AdminBundle\Admin\AdminInterface; use Sonata\AdminBundle\Route\RouteCollection; use Sonata\AdminBundle\Form\Type; use Sonata\AdminBundle\Validator\ErrorElement; use AppBundle\Entity\Suppliers as Suppliers; use AppBundle\Form\Type\CreateSupplierForm; use Symfony\Component\DependencyInjection\ContainerInterface; class SupplierAdmin extends Admin { protected $baseRouteName = 'Admin\SupplierAdmin'; protected $baseRoutePattern = 'supplier'; private $container; public function setContainer (ContainerInterface $container) { $this->container = $container; } protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->with('Supplier Details') ->add('id') ->add('name') ->add('created') ->end(); if ($this->getSubject()->getType() == 'LPE') { $showMapper->with('Property Expert') ->add('LpeFirstName', null, array('label' => 'First Name')) ->add('LpeLastName', null, array('label' => 'Last Name')) ->add('LpeEmail', null, array('label' => 'Email')) ->add('ContractType', null, array('label' => 'Type')) ->add('regions', 'entity', array( 'class' => 'AppBundle:Regions', "multiple" => true, 'label' => 'Regions Covered' )) ->end(); } } protected function configureListFields(ListMapper $listMapper) { $listMapper ->add('id') ->add('Type') ->addIdentifier('name') ->add('created', 'date', array( 'pattern' => 'dd/MM/Y @ H:m', 'locale' => 'en_GB', 'timezone' => 'Europe/London', ))
And finally, my supplier:
namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; use Symfony\Component\Validator\Constraints as Assert; class Suppliers { const TYPE_INTERNAL = 'internal'; const TYPE_EXTERNAL = 'external'; const TYPE_LPE = 'lpe'; protected static $types = array( self::TYPE_INTERNAL => 'Internal', self::TYPE_EXTERNAL => 'External', self::TYPE_LPE => 'LPE' ); private $id; private $type; private $name; private $created; private $updated; private $deleted; private $regions; private $lpe; public function __construct() { $this->regions = new ArrayCollection(); } public function getRegions() { return $this->regions; } public function setRegions($regions) { $this->regions = $regions; return $this; } public function getLpe() { return $this->lpe; } public function setLpe($lpe) { $this->lpe = $lpe; return $this; } public function getLpeFirstName() { return $this->lpe->getUser()->getFirstName(); } public function getLpeLastName() { return $this->lpe->getUser()->getLastName(); } public function getLpeEmail() { return $this->lpe->getUser()->getEmail(); } public function getContractType() { return $this->lpe->getContractType(); } public function getUser() { return $this->lpe->getUser(); } public function setUser($user) { $this->lpe->setUser($user); return $this; } public function setFirstName($name) { $this->user->setFirstName($name); return $this; } public function getFirstName() { return $this->user->getFirstName(); } public function setLastName($name) { $this->user->setLastName($name); return $this; } public function getLastName() { return $this->getUser()->getLastName(); } public function setEmail($email) { $this->getUser()->setEmail($email); return $this; } public function getEmail() { return $this->getUser()->getEmail(); } private $entityName; public function nullId() { return $this->id =null; } public function getId() { return $this->id; } public function setType($type) { $this->type = strtolower($type); return $this; } public function getType() { if ($this->type == 'lpe') { return strtoupper($this->type); } return ucwords($this->type); } public function setName($name) { $this->name = $name; return $this; } public function getName() { return $this->name; } public function setCreated($created) { if (!empty($created)) { $this->created = $created; } else { $this->created = new \DateTime("now"); } return $this; } public function getCreated() { return $this->created; } public function setUpdated($updated) { $this->updated = $updated; return $this; } public function getUpdated() { return $this->updated; } public function setDeleted($deleted) { $this->deleted = $deleted; return $this; } public function getDeleted() { return $this->deleted; } public function onPrePersist() { $this->created = new \DateTime(); $this->updated = new \DateTime(); if ($this->deleted === null) { $this->deleted = 0; } if ($this->type === null) { $this->type = 'lpe'; } if ($this->name === null) { $this->name = ''; } } public function onPreUpdate() { $this->created = new \DateTime(); $this->updated = new \DateTime(); if ($this->deleted === null) { $this->deleted = 0; } } public static function getTypes() { return self::$types; } public function setEntityName($name) { $this->entityName = $name; return $this; } public function __toString() { if ($this->getUser() === null) { return 'Supplier' . ($this->id !== null ? ' #' . $this->id.'' : '' ); } return (string) ($this->id !== null ? '#' . $this->id.' ' : '' ) . $this->getUser()->getEmail(); } }
Any suggestions?:)