Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I get the following PHP error after updating to Drupal 10 (using PHP 8.1.26). Otherwise the module seems to be working fine.
Warning: file_upload_options_filefield_paths_process_file(): Argument #3 ($settings) must be passed by reference, value given in Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (line 409 of core/lib/Drupal/Core/Extension/ModuleHandler.php).
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'file_upload_options') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('filefield_paths_process_file', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('filefield_paths_process_file', Array) (Line: 354)
filefield_paths_entity_update(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'filefield_paths') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 564)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 689)
Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->saveEntities(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 609)
Drupal\Core\Form\FormBuilder->processForm('views_form_posting_node_form_fields_447', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 224)
Drupal\Core\Form\FormBuilder->getForm(Object, Object, Array) (Line: 2269)
Drupal\views\Plugin\views\display\DisplayPluginBase->elementPreRender(Array) (Line: 751)
Drupal\ctools_views\Plugin\Display\Block->elementPreRender(Array)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 797)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 386)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 458)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 61)
__TwigTemplate_5f75cb635bd8d4455d3f4d9bf906cb92->block_content(Array, Array) (Line: 171)
Twig\Template->displayBlock('content', Array, Array) (Line: 49)
__TwigTemplate_5f75cb635bd8d4455d3f4d9bf906cb92->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
Twig\TemplateWrapper->render(Array) (Line: 53)
twig_render_template('themes/witebord/templates/block.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 445)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 458)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 97)
__TwigTemplate_c67340e8d174cf566f18fcf60933ad8b->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
Twig\TemplateWrapper->render(Array) (Line: 53)
twig_render_template('themes/witebord/templates/page.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 445)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 124)
__TwigTemplate_1870e5cb42f6cbc08d95d27216dea774->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
Twig\TemplateWrapper->render(Array) (Line: 53)
twig_render_template('themes/witebord/templates/html.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 445)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 159)
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(Object, 'kernel.view') (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 270)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 226)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#6 | 3405450-6.patch | 738 bytes | keshavv |
Comments
Comment #2
SandeepSingh199 CreditAttribution: SandeepSingh199 at Material for Drupal India Association commented@markdc, I have tested this module in Drupal 10.1 & PHP 8.1, but I didn’t get any error. Its very helpful if you provide steps to reproduce this error.
Comment #3
markdcSet up a node with a normal File field.
Field settings
Required
No translation
Allowed extensions: pdf
File (Field) Path settings
File path: "pdf"
File path options: all deactivated
File name: [node:nid].[node:field_file:entity:ffp-extension-original]
File name options: all deactivated
Create Redirect: no
Retroactive update: no
Active updating: no
Drupal config
The tmp directory is in the project root folder
Comment #4
markdcI noticed this warning in my Status Report:
I found this in the IQ: https://www.drupal.org/project/filefield_paths/issues/3119771
Could this be the cause of my error?
Comment #5
keshavv CreditAttribution: keshavv as a volunteer and at Axelerant for Drupal India Association commented@markdc No, It will not cause the issue, But if you want to fix this warning. Just execute this code using update_hook in a custom module or using the drush ev command
Comment #6
keshavv CreditAttribution: keshavv as a volunteer and at Axelerant for Drupal India Association commentedHere is the patch to fix the warning. https://www.drupal.org/files/issues/2024-01-22/3405450-6_0.patch
Comment #7
keshavv CreditAttribution: keshavv as a volunteer and at Axelerant for Drupal India Association commented