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, I've been tracking down this bug for a couple of days now and it's come down to these few lines:
function theme_media_formatter_large_icon($variables) {
$file = $variables['file'];
$icon_dir = variable_get('media__icon_base_directory', file_default_scheme() . '://media-icons/') . '/' . media_variable_get('icon_set');
$icon = file_icon_path($file, $icon_dir);
$variables['path'] = $icon;
If media__icon_base_directory is not defined this causes $icon_dir to be set as "public://media-icons//default/"
This causes issues with something at our server level configuration, I don't know how, but the url was changing to a single slash on the image_style_deliver callback causing a MENU_ACCESS_DENIED. I feel like this should be fixed anyway so here's a patch. If anyone could shed light on how this might be happening I would greatly appreciate it :)
Comment | File | Size | Author |
---|---|---|---|
#4 | 2076499-media-icon-base-dir.patch | 3.16 KB | Dave Reid |
#3 | media-icon-base-dir-double-slash-2076499-3.patch | 1.33 KB | Devin Carlson |
media-icon-base-dir-double-slash.patch | 1018 bytes | acbramley | |
Comments
Comment #1
rvallejo CreditAttribution: rvallejo commentedJust to clarify, are you working with the dev version? I'm seeing the line differently in alpha2.
Comment #2
acbramley CreditAttribution: acbramley commentedThis patch relates to the dev version yes
Comment #3
Devin Carlson CreditAttribution: Devin Carlson commentedThis also affects the copying of icons during installation.
Comment #4
Dave ReidHere's one with an update hook to fix the incorrect directory if it was set for new installs since alpha2 since we'd want to fix those. Realized that we want to hard-code the directory to public because if people have the directory set to private, then access to the thumbnails would be broken, so it makes sense to hard-code here. Also fixes the bad exception message in media_update_7216().
Comment #5
Dave ReidTested and committed #4 to 7.x-2.x.
http://drupalcode.org/project/media.git/commit/c182078
Comment #7
acbramley CreditAttribution: acbramley commentedHmmm, would've thought the person that raised and attempted to first fix this would at least get attribution...never mind.
Comment #8
Dave Reid@acbramley: Do you mind elaborating what you mean? There were three different people involved in patching this issue, and all three people were given credit in the commit message itself, which is the standard Drupal community behavior for commit attribution when there is more than one person involved. How should it have been done differently? Note the commit message itself was generated using Dreditor.
Comment #9
acbramley CreditAttribution: acbramley commented@Dave Reid, I'm not sure the convention of this but I thought it was a general rule to give the original patcher the authorship for the commit
Comment #10
Dave ReidNo, that is not actually the community convention.
Comment #11
acbramley CreditAttribution: acbramley commentedApologies, must just be my own convention :)