When using relationships, i get the error below.
base entity: user.
relationship -> entity [user refernece field].

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\views_entity_form_field\Plugin\views\field\EntityFormField::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/docroot/modules/contrib/views_entity_form_field/src/Plugin/views/field/EntityFormField.php on line 481 in Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->getEntityTranslation() (line 69 of core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php).

Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->getEntityTranslation(NULL, Object) (Line: 481)
Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->viewsForm(Array, Object) (Line: 60)
Drupal\views\Form\ViewsFormMainForm->buildForm(Array, Object, Object, Array) (Line: 169)
Drupal\views\Form\ViewsForm->buildForm(Array, Object, Object, Array)
call_user_func_array(Array, Array) (Line: 518)
Drupal\Core\Form\FormBuilder->retrieveForm('views_form_user_admin_people_page_4', Object) (Line: 275)
Drupal\Core\Form\FormBuilder->buildForm('views_form_user_admin_people_page_4', Object) (Line: 216)
Drupal\Core\Form\FormBuilder->getForm(Object, Object, Array) (Line: 2207)
Drupal\views\Plugin\views\display\DisplayPluginBase->elementPreRender(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 666)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
CommentFileSizeAuthor
#6 2986849-6-relationship-error.patch2.15 KBtemkin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ivanhelguera created an issue. See original summary.

ivanhelguera’s picture

Issue summary: View changes

grathbone’s picture

Status: Active » Needs review

@ivanhelguera Fixed this. Take a look at Beta 7 and let me know if the issue persists.

heddn’s picture

Status: Needs review » Postponed (maintainer needs more info)
temkin’s picture

Version: 8.x-1.0-beta6 » 8.x-1.0-beta7
Status: Postponed (maintainer needs more info) » Needs review
FileSize
2.15 KB

I was getting the same error when saving a row with missing relationship entity. Attached patch fixed it for me.

  • 4ea8328 committed on 8.x-1.x
    Issue #2986849 by temkin, ivanhelguera, grathbone, heddn: Relationship...
grathbone’s picture

Status: Needs review » Fixed

This has been committed and included in Beta 8. Thank you everyone for the work!

Status: Fixed » Closed (fixed)

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