- Issue created by @rkoller
- π©πͺGermany rkoller NΓΌrnberg, Germany
revisited the issue today and was unable to reproduce it for newly created nodes and their translations. the error outlined in the issue summary seems exclusive to the one translated node i first ran into the issue. but there are some warnings in the recent log messages i completely forgot to check when i wrote up the issue. on each save there are these two entries:
location:
https://modi.ddev.site/de/media_library_media_modify?_wrapper_format=drupal_ajax&ajax_form=1&destination=%2Fadmin%2Fcontent&hash=YRK2p-SDFvLlc-Yf-Dpx2xabT12UFryYi5UHqX-9Sx4
Referrer
https://modi.ddev.site/de/node/2/edit?destination=/admin/content
Message
Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\file\Element\ManagedFile::uploadAjaxCallback() (line 184 of /var/www/html/web/core/modules/file/src/Element/ManagedFile.php) #0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'explode(): Pass...', '/var/www/html/w...', 184) #1 [internal function]: _drupal_error_handler(8192, 'explode(): Pass...', '/var/www/html/w...', 184) #2 /var/www/html/web/core/modules/file/src/Element/ManagedFile.php(184): explode('/', NULL) #3 [internal function]: Drupal\file\Element\ManagedFile::uploadAjaxCallback(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request)) #4 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array) #5 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array) #6 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\tracer\EventDispatcher\TraceableEventDispatcher)) #7 /var/www/html/web/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php(93): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\tracer\EventDispatcher\TraceableEventDispatcher)) #8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(240): Drupal\tracer\EventDispatcher\TraceableEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...') #9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1) #10 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /var/www/html/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php(42): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/html/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php(34): Drupal\tracer\StackMiddleware\TracesMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #21 {main}
Location
https://modi.ddev.site/de/media_library_media_modify?_wrapper_format=drupal_ajax&ajax_form=1&destination=%2Fadmin%2Fcontent&hash=YRK2p-SDFvLlc-Yf-Dpx2xabT12UFryYi5UHqX-9Sx4
Referrer
https://modi.ddev.site/de/node/2/edit?destination=/admin/content
Message
Warning: Undefined array key "#prefix" in Drupal\file\Element\ManagedFile::uploadAjaxCallback() (line 199 of /var/www/html/web/core/modules/file/src/Element/ManagedFile.php) #0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(2, 'Undefined array...', '/var/www/html/w...', 199) #1 /var/www/html/web/core/modules/file/src/Element/ManagedFile.php(199): _drupal_error_handler(2, 'Undefined array...', '/var/www/html/w...', 199) #2 [internal function]: Drupal\file\Element\ManagedFile::uploadAjaxCallback(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request)) #3 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array) #4 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array) #5 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\tracer\EventDispatcher\TraceableEventDispatcher)) #6 /var/www/html/web/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php(93): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\tracer\EventDispatcher\TraceableEventDispatcher)) #7 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(240): Drupal\tracer\EventDispatcher\TraceableEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...') #8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1) #9 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /var/www/html/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php(42): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /var/www/html/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php(34): Drupal\tracer\StackMiddleware\TracesMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #20 {main}
And i forgot to mention the setup. It is Drupal 10.1.5 with PHP 8.2.11 and MariaDB 10.5.22 on DDEV
- πΊπ¦Ukraine ankondrat4 Lutsk
Hello.
This issue related to module file of Drupal core core/modules/file/src/Element/ManagedFile.php - Merge request !9934Issue #3394728: Undefined array key "#prefix" and deprecated function:... β (Open) created by ankondrat4
- πΊπ¦Ukraine ankondrat4 Lutsk
ankondrat4 β changed the visibility of the branch 3394728-saving-a-media to hidden.
- πΊπΈUnited States smustgrave
Issue summary appears incomplete. With these kind of issues putting just an empty check usually isn't correct. Need to do some backtracing and figure out why it's undefined so we aren't masking a larger issue.
- πΊπΈUnited States jackfoust
I think this is a duplicate of https://www.drupal.org/project/drupal/issues/3389000 π Malformed file field AJAX request leads to 'Warning: Undefined array key "#prefix"' Needs work ?