I am trying to download a file with this module enabled using the file entity module field formatter and I get this error. I tried to debug, but I don't see where this would be the case.
The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to xmlsitemap_file_transfer() must be an instance of Symfony\Component\HttpFoundation\Response, string given in xmlsitemap_file_transfer() (line 2222 of modules/contrib/xmlsitemap/xmlsitemap.module).
xmlsitemap_file_transfer('public://2017-04/Vertical_City_Black_0.jpg', Array)
call_user_func_array('xmlsitemap_file_transfer', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('file_transfer', Array) (Line: 79)
Drupal\file_entity\Controller\FileController->download(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: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#9 | 2869214-hook-file-transfer-conflict.patch | 10.59 KB | Dave Reid |
| |||
#6 | 2869214-hook-file-transfer-conflict.patch | 11.36 KB | Dave Reid |
#2 | xmlsitemap_file_transfer-fatal-error-2869214-2.patch | 736 bytes | Chewie |
Comments
Comment #2
Chewie CreditAttribution: Chewie at Adyax commentedHave the same issue. Here patch that I hope will solve this issue
Comment #3
Dave ReidHrm, let's figure out if we can find something that works without having to rename a "public" function in our module.
Comment #4
Dave ReidComment #5
Dave ReidI wonder if it's worth doing #3006887: Convert xmlsitemap_output_file() and xmlsitemap_transfer_file() to a Response object sooner rather than later too.
Comment #6
Dave ReidI ended up merging what I had intended to do with #3006887: Convert xmlsitemap_output_file() and xmlsitemap_transfer_file() to a Response object with this effort. I'd rather get this fixed properly and remove a hook conflict function earlier rather than later.
Comment #7
Dave ReidI drafted two change notices about these xmlsitemap_file_transfer() being removed, and xmlsitemap_output_file() being deprecated
Comment #9
Dave ReidThis time without the irrelevant patch section.
Comment #11
Dave ReidCommitted #9 to 8.x-1.x, but I'm filing a follow-up issue because we could really use some kernel tests around the cache handling and headers in the sitemap response.
Comment #12
Dave ReidChange records have been published as well.