- Issue created by @goose2000
- πΊπΈUnited States goose2000
Testing note, if I try adding the CT (B) by itself, stand alone form (not in a referenced form), all the file uploading and links appear as you would expect.
I have found that I cannot upload a file, from a child content type, form using the Inline entity form - Simple widget.
Although, the file will go to the server.
Nothing (file) gets attached to the form like normal after choosing and upload complete.
Create a parent and a child content type.
Parent (A) will add a field to reference the child (B) CT.
Configure this filed to 'Create referenced entities if they don't already exist'
Also set allowed number of values to Unlimited (this will give us the Add another item button)
In parent A, set the reference field, form display setting, to Inline entity form - Simple widget
In this child CT (B) add a file field, you can set it to accept whatever files.
You could make this a required field.
With a user account, with proper permission, begin to create parent type (A) and in the form try to add a new file in the in this form. You will see the file does go to the server but nothing is attached or displayed on the form.
No type B gets created and the Parent A cannot be saved, as this field is required.
Drupal 10.3.5
PHP 8.1.29
My file settings do no processing or replacement characters.
Location https://sswnt4.ad.blah.blah/node/add/certification_app?_wrapper_format=drupal_ajax&ajax_form=1&element_parents=field_app_additional_train%2Fwidget%2F0%2Finline_entity_form%2Ffield_app_cert_upload%2Fwidget%2F0
Warning: foreach() argument must be of type array|object, null given in Drupal\file\Plugin\Field\FieldWidget\FileWidget::submit() (line 564 of D:\wwwroot\pss-2024-fix\web\core\modules\file\src\Plugin\Field\FieldWidget\FileWidget.php)
#0 D:\wwwroot\pss-2024-fix\web\core\includes\bootstrap.inc(166): _drupal_error_handler_real(2, 'foreach() argum...', 'D:\\wwwroot\\pss-...', 564)
#1 D:\wwwroot\pss-2024-fix\web\core\modules\file\src\Plugin\Field\FieldWidget\FileWidget.php(564): _drupal_error_handler(2, 'foreach() argum...', 'D:\\wwwroot\\pss-...', 564)
#2 [internal function]: Drupal\file\Plugin\Field\FieldWidget\FileWidget::submit(Array, Object(Drupal\Core\Form\FormState))
#3 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormSubmitter.php(129): call_user_func_array(Array, Array)
#4 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#5 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#6 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('node_certificat...', Array, Object(Drupal\Core\Form\FormState))
#7 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Controller\FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#8 D:\wwwroot\pss-2024-fix\web\core\modules\layout_builder\src\Controller\LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#9 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#10 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#11 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Render\Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#12 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#13 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#14 D:\wwwroot\pss-2024-fix\vendor\symfony\http-kernel\HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 D:\wwwroot\pss-2024-fix\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#16 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 D:\wwwroot\pss-2024-fix\web\core\modules\big_pipe\src\StackMiddleware\ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 D:\wwwroot\pss-2024-fix\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 D:\wwwroot\pss-2024-fix\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 D:\wwwroot\pss-2024-fix\web\core\modules\ban\src\BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 D:\wwwroot\pss-2024-fix\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#29 {main}
Active
3.0
Code
Testing note, if I try adding the CT (B) by itself, stand alone form (not in a referenced form), all the file uploading and links appear as you would expect.