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.
Hi,
for generating the URL to the county icon the url() function is currently used in countryicons_get_icon_url(). Unfortunately, url() breaks for files if you have a multilingual website and language prefixes in the URL, e.g. http://example.com/en. Any URL generated by url() will be passed to hook_url_outbound_alter() and the locale module then adds the language prefix. However, that's not the behaviour we want for files, the url for county icons will be wrong in that case. Instead we have to use file_create_url() that is save against url rewriting.
Attached patch fixes this issue.
Comment | File | Size | Author |
---|---|---|---|
countryicons_file_create_url.patch | 489 bytes | mh86 |
Comments
Comment #1
Scyther CreditAttribution: Scyther commentedThanks for that bug!
Comment #2
Scyther CreditAttribution: Scyther commentedYour patch says
file_create_url()
only takes one paramater$uri
, so this might need some work.https://api.drupal.org/api/drupal/includes!file.inc/function/file_create...