Steps to reproduce:

1) Add a new address field on a content type
2) Go to admin/content
3) See the error

Notice: Undefined index: field_asasa in address_field_views_data() (line 38 of modules/address/address.views.inc).
address_field_views_data(Object)
call_user_func_array('address_field_views_data', Array)
Drupal\Core\Extension\ModuleHandler->invoke('address', 'field_views_data', Array)
views_views_data()
call_user_func_array('views_views_data', Array)
Drupal\Core\Extension\ModuleHandler->invoke('views', 'views_data')
Drupal\views\ViewsData->getData()
Drupal\views\ViewsData->get('node')
Drupal\views\Plugin\ViewsHandlerManager->getHandler(Array, NULL)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('field')
Drupal\views\ViewExecutable->_initHandler('field', Array)
Drupal\views\ViewExecutable->initHandlers()
Drupal\views\Plugin\views\display\DisplayPluginBase->preExecute()
Drupal\views\ViewExecutable->preExecute(Array)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array)
Drupal\Core\Render\Renderer->doRender(Array, )
Drupal\Core\Render\Renderer->render(Array, )
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)

Comments

joshtaylor created an issue. See original summary.

bojanz’s picture

Title: Adding a new address field on a content type results in "Notice: Undefined index: field_asasa in address_field_views_data() (line 38" » Notice: Undefined index: field_asasa in address_field_views_data() (line 38)
Priority: Major » Normal

address_field_views_data() is relying on the presence of the default views definitions for the address field. The hook might be running too early, when those definitions aren't available yet.

rootwork’s picture

I'm seeing this as well on views pages when I go to add new fields to a view. 8.0.0-beta16.

rootwork’s picture

Title: Notice: Undefined index: field_asasa in address_field_views_data() (line 38) » Notice: Undefined index: [address field name] in address_field_views_data() (line 38)

  • bojanz committed 4ce67dc on 8.x-1.x
    Issue #2559751: Notice: Undefined index: [address field name] in...
bojanz’s picture

Status: Active » Fixed

Looks like we don't actually need the lines that were causing the notice (the joy of assoc array APIs), so I've just removed them.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.