Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294953

File links with query parameters no longer work

$
0
0

Problem/Motivation

If a file url has query parameters, or a hash, added to it. The file-link component strips these out.

Drupal would not normally use query parameters on a file url. But in our case they are being added in by a stream wrapper, from the flysystem_s3 module (we are using them to pass through a url signature, to allow the user access to the file).

Query parameters could also be added in by hook_file_url_alter(), these would again be stripped out.

The issue is caused by the new file handling in template_preprocess_file_link(), which used to create the Url object itself, but now uses the new file_url_generator service. Since this changed was introduced, the $options is being overwritten by $url->setOptions($options)

Steps to reproduce

Proposed resolution

Use
$url->mergeOptions($options)
Instead of
$url->setOptions($options)

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294953

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>