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.
We have file names containing the '#' character. When node view is set to 'url to file' display, '#' is properly encoded as '#23', but when node view is set to 'generic file display' it is not properly encoded, resulting in page not found error.
Fixed by adding
$url = file_create_url($path);
/* '#' fix */ $url = str_replace('#', '%23', $url);
$icon = theme('filefield_icon', $file);
to line 125 in filefield_formatter.inc
Comments
Comment #1
quicksketchUnfortunately this is a Drupal core bug, see #238299: file_create_url should return valid URLs. I suggest installing Transliteration to avoid the problem.
Comment #2
quicksketchSorry that issue was marked duplicate, here's the issue that now addresses it: #284899: Drupal url problem with clean urls.
Comment #3
quicksketchComment #4
heacu CreditAttribution: heacu commentedsubscribe