- š¦šŗAustralia imclean Tasmania
Has anyone else had a chance to review this? Does this solve the problem @FiNeX?
- Status changed to RTBC
7 months ago 10:18am 31 May 2024 - šµšPhilippines cleavinjosh
Hi @imclean,
I'm not sure if this is the problem of @FiNex but I have noticed that after I installed the File Upload Options 8.x-1.x-dev , I get an error when trying to add an image file via /media/add/image, please see my attached file error-found-before-patch.
Drupal.AjaxErrormessage: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 500\nDebugging information follows.\nPath: /media/add/image?element_parents=field_media_image/widget/0&ajax_form=1\nStatusText: 500 Service unavailable (with message)\nResponseText: The website encountered an unexpected error. Please try again later.TypeError: Drupal\\file\\Upload\\FileUploadHandler::handleFileUpload(): Argument #4 ($replace) must be of type int, null given, called in /var/www/web/core/modules/file/file.module on line 642 in Drupal\\file\\Upload\\FileUploadHandler->handleFileUpload() (line 157 of core/modules/file/src/Upload/FileUploadHandler.php). file_save_upload('field_media_image_0', Array, 'public://2024-05', NULL, NULL) (Line: 520)\n_file_save_upload_from_form(Array, Object, NULL, NULL) (Line: 224)\nfile_upload_options_file_managed_file_save_upload(Array, Object) (Line: 173)\nDrupal\\file_upload_options\\Services\\FileUploadService::valueCallback(Array, Array, Object) (Line: 144)\nDrupal\\file_upload_options\\Services\\FileUploadService::value(Array, Array, Object)\ncall_user_func_array(Array, Array) (Line: 1268)\nDrupal\\Core\\Form\\FormBuilder->handleInputElement('media_image_add_form', Array, Object) (Line: 1005)\nDrupal\\Core\\Form\\FormBuilder->doBuildForm('media_image_add_form', Array, Object) (Line: 1075)\nDrupal\\Core\\Form\\FormBuilder->doBuildForm('media_image_add_form', Array, Object) (Line: 1075)\nDrupal\\Core\\Form\\FormBuilder->doBuildForm('media_image_add_form', Array, Object) (Line: 1075)\nDrupal\\Core\\Form\\FormBuilder->doBuildForm('media_image_add_form', Array, Object) (Line: 579)\nDrupal\\Core\\Form\\FormBuilder->processForm('media_image_add_form', Array, Object) (Line: 325)\nDrupal\\Core\\Form\\FormBuilder->buildForm(Object, Object) (Line: 73)\nDrupal\\Core\\Controller\\FormController->getContentResult(Object, Object) (Line: 39)\nDrupal\\layout_builder\\Controller\\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)\ncall_user_func_array(Array, Array) (Line: 123)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 592)\nDrupal\\Core\\Render\\Renderer->executeInRenderContext(Object, Object) (Line: 121)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 181)\nSymfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object, 1) (Line: 76)\nSymfony\\Component\\HttpKernel\\HttpKernel->handle(Object, 1, 1) (Line: 58)\nDrupal\\Core\\StackMiddleware\\Session->handle(Object, 1, 1) (Line: 48)\nDrupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object, 1, 1) (Line: 106)\nDrupal\\page_cache\\StackMiddleware\\PageCache->pass(Object, 1, 1) (Line: 85)\nDrupal\\page_cache\\StackMiddleware\\PageCache->handle(Object, 1, 1) (Line: 48)\nDrupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)\nDrupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)\nDrupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)\nDrupal\\Core\\DrupalKernel->handle(Object) (Line: 19)\n"name: "AjaxError"stack: "Error\n at http://drupal-org-issues.docksal.site/core/misc/ajax.js?v=10.1.8:196:32\n at http://drupal-org-issues.docksal.site/core/misc/ajax.js?v=10.1.8:1889:3"[[Prototype]]: Error at http://drupal-org-issues.docksal.site/core/misc/ajax.js?v=10.1.8:196:32 at http://drupal-org-issues.docksal.site/core/misc/ajax.js?v=10.1.8:1889:3
I then applied @cinarb's patch #19. It was applied smoothly and then I don't encounter the issue afterwards when I tried to add an image file via /media/add/image, please see my attached file image-added-after-patch.
ā file_upload_options git:(d2b302c) curl https://www.drupal.org/files/issues/2022-10-27/3315976-19.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4392 100 4392 0 0 9594 0 --:--:-- --:--:-- --:--:-- 9589 patching file file_upload_options.install patching file file_upload_options.module Hunk #2 succeeded at 279 (offset 16 lines). ā file_upload_options git:(d2b302c) ā
I will move the status to Reviewed & tested by the community.
Thank you.
- Status changed to Needs review
7 months ago 4:47am 3 June 2024 - š¦šŗAustralia imclean Tasmania
Thanks @cleavinjosh, I'd liked to hear from @FiNeX as well if possible.