Symfony 4: Свойство App \ Entity \ Ad :: $ site не существует (но невозможно найти в коде?) - PullRequest
0 голосов
/ 22 октября 2019

У меня была ссылка на сайт класса для моего класса Annonce. Я удалил все, что касается «Сайта», произвел миграцию с помощью доктрины.

Затем появилась эта ошибка.

Итак, я сделал поиск во всем файле, чтобы увидеть, находится ли «сайт» где-нибудь, и удалилвезде.

И у меня все еще есть эта ошибка. Я не знаю что делать?

Может быть проблема с кешем?

Это трассировка стека

ReflectionException:
Property App\Entity\Annonce::$site does not exist

  at vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:63
  at ReflectionProperty->__construct('App\\Entity\\Annonce', 'site')
     (vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:63)
  at Doctrine\Common\Persistence\Mapping\RuntimeReflectionService->getAccessibleProperty('App\\Entity\\Annonce', 'site')
     (vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:970)
  at Doctrine\ORM\Mapping\ClassMetadataInfo->wakeupReflection(object(RuntimeReflectionService))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:750)
  at Doctrine\ORM\Mapping\ClassMetadataFactory->wakeupReflection(object(ClassMetadata), object(RuntimeReflectionService))
     (vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:181)
  at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('App\\Entity\\Annonce')
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:283)
  at Doctrine\ORM\EntityManager->getClassMetadata('App\\Entity\\Annonce')
     (vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2692)
  at Doctrine\ORM\UnitOfWork->createEntity('App\\Entity\\Categorie', array('id' => 1, 'nom' => 'Bar Tabac PMU'), array('deferEagerLoad' => true, 'fetchAlias' => 'e'))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:271)
  at Doctrine\ORM\Internal\Hydration\ObjectHydrator->getEntity(array('id' => 1, 'nom' => 'Bar Tabac PMU'), 'e')
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:492)
  at Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateRowData(array('id_0' => '1', 'nom_1' => 'Bar Tabac PMU'), array())
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:162)
  at Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateAllData()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:152)
  at Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll(object(PDOStatement), object(ResultSetMapping), array())
     (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:976)
  at Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(null, null)
     (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:922)
  at Doctrine\ORM\AbstractQuery->execute()
     (vendor/symfony/doctrine-bridge/Form/ChoiceList/ORMQueryBuilderLoader.php:50)
  at Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader->getEntities()
     (vendor/symfony/doctrine-bridge/Form/ChoiceList/DoctrineChoiceLoader.php:85)
  at Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader->loadChoiceList(array(object(IdReader), 'getIdValue'))
     (vendor/symfony/form/ChoiceList/LazyChoiceList.php:62)
  at Symfony\Component\Form\ChoiceList\LazyChoiceList->getChoices()
     (vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php:53)
  at Symfony\Component\Form\ChoiceList\Factory\DefaultChoiceListFactory->createView(object(LazyChoiceList), array(), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), null, null)
     (vendor/symfony/form/ChoiceList/Factory/PropertyAccessDecorator.php:193)
  at Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator->createView(object(LazyChoiceList), array(), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), null, null)
     (vendor/symfony/form/ChoiceList/Factory/CachingFactoryDecorator.php:127)
  at Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator->createView(object(LazyChoiceList), array(), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), null, null)
     (vendor/symfony/form/Extension/Core/Type/ChoiceType.php:410)
  at Symfony\Component\Form\Extension\Core\Type\ChoiceType->createChoiceListView(object(LazyChoiceList), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => false, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'help_translation_parameters' => array(), 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'multiple' => false, 'expanded' => false, 'block_prefix' => null, 'label' => 'Catégorie de commerce *', 'row_attr' => array(), 'attr' => array(), 'data_class' => null, 'empty_data' => '', 'required' => true, 'error_bubbling' => false, 'label_attr' => array(), 'compound' => false, 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'validation_groups' => null, 'constraints' => array(), 'choices' => null, 'query_builder' => null, 'class' => 'App\\Entity\\Categorie', 'em' => object(EntityManager), 'id_reader' => object(IdReader), 'choice_loader' => object(DoctrineChoiceLoader), 'choice_label' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), 'choice_name' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), 'choice_value' => array(object(IdReader), 'getIdValue'), 'choice_attr' => null, 'preferred_choices' => array(), 'group_by' => null, 'placeholder' => 'Choisir une catégorie', 'choice_translation_domain' => false))
     (vendor/symfony/form/Extension/Core/Type/ChoiceType.php:185)
  at Symfony\Component\Form\Extension\Core\Type\ChoiceType->buildView(object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => false, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'help_translation_parameters' => array(), 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'multiple' => false, 'expanded' => false, 'block_prefix' => null, 'label' => 'Catégorie de commerce *', 'row_attr' => array(), 'attr' => array(), 'data_class' => null, 'empty_data' => '', 'required' => true, 'error_bubbling' => false, 'label_attr' => array(), 'compound' => false, 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'validation_groups' => null, 'constraints' => array(), 'choices' => null, 'query_builder' => null, 'class' => 'App\\Entity\\Categorie', 'em' => object(EntityManager), 'id_reader' => object(IdReader), 'choice_loader' => object(DoctrineChoiceLoader), 'choice_label' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), 'choice_name' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), 'choice_value' => array(object(IdReader), 'getIdValue'), 'choice_attr' => null, 'preferred_choices' => array(), 'group_by' => null, 'placeholder' => 'Choisir une catégorie', 'choice_translation_domain' => false))
     (vendor/symfony/form/ResolvedFormType.php:148)
  at Symfony\Component\Form\ResolvedFormType->buildView(object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => false, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'help_translation_parameters' => array(), 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'multiple' => false, 'expanded' => false, 'block_prefix' => null, 'label' => 'Catégorie de commerce *', 'row_attr' => array(), 'attr' => array(), 'data_class' => null, 'empty_data' => '', 'required' => true, 'error_bubbling' => false, 'label_attr' => array(), 'compound' => false, 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'validation_groups' => null, 'constraints' => array(), 'choices' => null, 'query_builder' => null, 'class' => 'App\\Entity\\Categorie', 'em' => object(EntityManager), 'id_reader' => object(IdReader), 'choice_loader' => object(DoctrineChoiceLoader), 'choice_label' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), 'choice_name' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), 'choice_value' => array(object(IdReader), 'getIdValue'), 'choice_attr' => null, 'preferred_choices' => array(), 'group_by' => null, 'placeholder' => 'Choisir une catégorie', 'choice_translation_domain' => false))
     (vendor/symfony/form/ResolvedFormType.php:145)
  at Symfony\Component\Form\ResolvedFormType->buildView(object(FormView), object(Form), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => false, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'help_translation_parameters' => array(), 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(CsrfTokenManager), 'csrf_token_id' => null, 'multiple' => false, 'expanded' => false, 'block_prefix' => null, 'label' => 'Catégorie de commerce *', 'row_attr' => array(), 'attr' => array(), 'data_class' => null, 'empty_data' => '', 'required' => true, 'error_bubbling' => false, 'label_attr' => array(), 'compound' => false, 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'validation_groups' => null, 'constraints' => array(), 'choices' => null, 'query_builder' => null, 'class' => 'App\\Entity\\Categorie', 'em' => object(EntityManager), 'id_reader' => object(IdReader), 'choice_loader' => object(DoctrineChoiceLoader), 'choice_label' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceLabel'), 'choice_name' => array('Symfony\\Bridge\\Doctrine\\Form\\Type\\DoctrineType', 'createChoiceName'), 'choice_value' => array(object(IdReader), 'getIdValue'), 'choice_attr' => null, 'preferred_choices' => array(), 'group_by' => null, 'placeholder' => 'Choisir une catégorie', 'choice_translation_domain' => false))
     (vendor/symfony/form/Form.php:1030)
  at Symfony\Component\Form\Form->createView(object(FormView))
     (vendor/symfony/form/Form.php:1033)
  at Symfony\Component\Form\Form->createView()
     (src/Controller/AnnonceController.php:60)
  at App\Controller\AnnonceController->newFree(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:198)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:22)

Спасибо

1 Ответ

1 голос
/ 23 октября 2019

Это определенно проблема с кешем. Попробуйте выполнить следующие действия по порядку и посмотрите, поможет ли это:

  • кэш bin / console: очистить
  • rm папка var / cache
  • очистить вручную любой дополнительный кэш PHP вручнуювозможно, вы включили
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...