Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: property in ViewConfigPass.php #2941

Closed
shakaran opened this issue Sep 24, 2019 · 1 comment · Fixed by #2944
Closed

Undefined index: property in ViewConfigPass.php #2941

shakaran opened this issue Sep 24, 2019 · 1 comment · Fixed by #2944

Comments

@shakaran
Copy link
Contributor

Describe the bug

The code doesn't check if the field config don't have a property.

if (!isset($fieldConfig['label']) && 'id' === $fieldConfig['property']) {
Should be:

if (!isset($fieldConfig['label']) && isset($fieldConfig['property']) && 'id' === $fieldConfig['property'] ){

In config, set something like:

- { type: 'divider' }

(OPTIONAL) Additional context

ErrorException:
Notice: Undefined index: property

  at vendor/easycorp/easyadmin-bundle/src/Configuration/ViewConfigPass.php:93
  at EasyCorp\Bundle\EasyAdminBundle\Configuration\ViewConfigPass->processFieldConfig(array('r', 'S'))
     (vendor/easycorp/easyadmin-bundle/src/Configuration/ViewConfigPass.php:17)
  at EasyCorp\Bundle\EasyAdminBundle\Configuration\ViewConfigPass->process(array('r', 'S'))
     (vendor/easycorp/easyadmin-bundle/src/Configuration/ConfigManager.php:104)
  at EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager->doProcessConfig(array('r', 'S'))
     (vendor/easycorp/easyadmin-bundle/src/Configuration/ConfigManager.php:117)
  at EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager->loadBackendConfig()
     (vendor/easycorp/easyadmin-bundle/src/Configuration/ConfigManager.php:41)
  at EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager->getBackendConfig()
     (vendor/easycorp/easyadmin-bundle/src/DataCollector/EasyAdminDataCollector.php:52)
  at EasyCorp\Bundle\EasyAdminBundle\DataCollector\EasyAdminDataCollector->collect(object(Request), object(RedirectResponse), null)
     (vendor/symfony/http-kernel/Profiler/Profiler.php:167)
  at Symfony\Component\HttpKernel\Profiler\Profiler->collect(object(Request), object(RedirectResponse), null)
     (vendor/symfony/http-kernel/EventListener/ProfilerListener.php:93)
  at Symfony\Component\HttpKernel\EventListener\ProfilerListener->onKernelResponse(object(ResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:126)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:260)
  at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(ResponseEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:235)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(ResponseEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:73)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ResponseEvent), 'kernel.response')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:168)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ResponseEvent), 'kernel.response')
     (vendor/symfony/http-kernel/HttpKernel.php:190)
  at Symfony\Component\HttpKernel\HttpKernel->filterResponse(object(RedirectResponse), object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:172)
  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:25)
@javiereguiluz
Copy link
Collaborator

Thanks for reporting this error!

I can confirm that this happens when adding things like type: 'divider' in the views where it's not supported (list, search). I've fixed it as you proposed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants