I am using Content Import to import into a content type that has a Paragraph field on it. I was getting the following error.

Notice: Undefined index: field_flexible_content in Drupal\contentimport\Form\ContentImport->createNode() (line 274 of modules/contrib/contentimport/src/Form/ContentImport.php).

Drupal\contentimport\Form\ContentImport->createNode('equipment') (Line: 83)
Drupal\contentimport\Form\ContentImport->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('contentimport', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('contentimport', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 142)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
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: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

After looking at the field types in my content type and reviewing the switch statement in the module. I found that the field type of entity_reference_revisions wasn't present.

I will upload a patch that resolves the issue.

Comments

johnpicozzi created an issue. See original summary.

johnpicozzi’s picture

Here is the patch that resolved the issue for me.

johnpicozzi’s picture

Here is a patch for 8.x-3.2

  • johnpicozzi authored 6616556 on 8.x-3.x
    Issue #2923192 by johnpicozzi: Can't import $fieldType of...
dhayanandan_k’s picture

@johnpicozzi Thank you for providing the patch. I have added it in dev version. Please check

dhayanandan_k’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

knorton’s picture

Closed

giorgosk’s picture

So how does one import to a paragraph field "entity_reference_revisions"

I have a field field_paragraphs with type text which has a field field_text

I have put the following in the csv

field_paragraphs
text:field_text: "this is my text"
field_text: "this is my text"
text: "this is my text"

but neither of the three are working

johnpicozzi’s picture

@GiorgosK At this time I don't think the module supports importing into a paragraph.

giorgosk’s picture

so what was this patch about ?
its a patch that probably does not solve anything I believe

johnpicozzi’s picture

@GiorgosK - The Patch was to prevent error with the import for content types that had a Paragraph field on them. I was seeing errors when trying to import content to a content type that had paragraph fields. To resolve the error I made the module aware of paragraphs field types, but didn't go any further than that.

giorgosk’s picture

@johnpicozzi
thanks makes sense now