In my Drupal project I have this error:
The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to Drupal\Core\Entity\EntityViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /Users/team1/workspace/ga_p/modules/field_collection/src/Plugin/Field/FieldFormatter/FieldCollectionItemsFormatter.php on line 33 and defined in Drupal\Core\Entity\EntityViewBuilder->view() (line 110 of core/lib/Drupal/Core/Entity/EntityViewBuilder.php).
Drupal\Core\Entity\EntityViewBuilder->view(NULL) (Line: 33)
Drupal\field_collection\Plugin\Field\FieldFormatter\FieldCollectionItemsFormatter->viewElements(Object, 'es') (Line: 80)
Drupal\Core\Field\FormatterBase->view(Object, 'es') (Line: 259)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 320)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'search_index') (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'search_index') (Line: 263)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 220)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 151)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 152)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 480)
Drupal\node\Plugin\Search\NodeSearch->indexNode(Object) (Line: 452)
Drupal\node\Plugin\Search\NodeSearch->updateIndex() (Line: 195)
search_cron()
call_user_func_array('search_cron', Array) (Line: 391)
Drupal\Core\Extension\ModuleHandler->invoke('search', 'cron') (Line: 223)
Drupal\Core\Cron->invokeCronHandlers() (Line: 122)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 65)
Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object, 'kernel.terminate', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminate', Object) (Line: 84)
Symfony\Component\HttpKernel\HttpKernel->terminate(Object, Object) (Line: 32)
Stack\StackedHttpKernel->terminate(Object, Object) (Line: 634)
Drupal\Core\DrupalKernel->terminate(Object, Object) (Line: 22)
Field collection version: 8.x-1.0-alpha1
I do not know how to remove this error.
Drupal Version: 8.3.4
Comment | File | Size | Author |
---|---|---|---|
#15 | field_collection-recoverable_fatal_error-2909837-15.patch | 856 bytes | Spokje |
#9 | field_collection-recoverable_fatal_error-2909837-8.patch | 856 bytes | unrealauk |
#6 | field_collection-recoverable_fatal_error-2909837-6.patch | 1.21 KB | mqanneh |
#4 | field_collection-2909837-4.patch | 1.58 KB | olofbokedal |
#3 | field_collection-2909837-3.patch | 710 bytes | gilmord |
Comments
Comment #2
orbistertius CreditAttribution: orbistertius as a volunteer commentedI guess this is more or less the same error but not viewing the field collection but editing:
This happens only on one of my ECK Entity Bundle with a field collection (there are many where it works), I resaved all configurations. Other thing is that I am not able to add the field collections of this entity bundle to a view, here the preview disappears...
Hope someone can help or there is an other report/patch handling this.
Comment #3
gilmordHi,
Here is small temp patch to fix the issue.
Comment #4
olofbokedal CreditAttribution: olofbokedal at Odd Hill commentedUpdated the small patch in order to also handle the formatter. Same simple logics, it just avoids the crash.
Comment #5
mqannehThis needs to be rerolled against latest dev version.
Comment #6
mqannehRerolled the patch against latest dev version 3.x-dev
Comment #7
unrealauk CreditAttribution: unrealauk at AnyforSoft for Drupal Ukraine Community commentedPlease, review my commit to it.
Comment #9
unrealauk CreditAttribution: unrealauk at AnyforSoft for Drupal Ukraine Community commentedCorrected patch file according to the version of module -> 8.x-1.0-alpha1
Comment #10
Alan D. CreditAttribution: Alan D. commentedI used this
but really should be something like !$item->isEmpty() yada yada. No ide or time to play
Comment #11
ram4nd CreditAttribution: ram4nd as a volunteer commentedComment #12
Alan D. CreditAttribution: Alan D. commentedThe code for the formatter is completely unchanged so reopening for clarification:
* was this outdated magically by another change somewhere?
* the patch doesn't apply?
* you couldn't replicate?
* is the module totally unsupported?
* and / or were you just randomly closing issues?
Comment #13
ram4nd CreditAttribution: ram4nd as a volunteer commentedComment #14
Alan D. CreditAttribution: Alan D. commentedThanks, context is much better.
Comment #15
SpokjePatch against tag
8.x-1.0-alpha
which I desperately needed whilst (Oh, the irony...) in the middle of converting my field_collections into paragraphs.