
Hello!
After using the theme settings to upload a custom logo for the a theme, the path used to display the logo does not point to default/files/ but to the root of the install. I was able to upload a custom logo once, but never again.
Comment | File | Size | Author |
---|---|---|---|
#29 | test_only.patch | 1.79 KB | catch |
#14 | 901724-14.patch | 3.16 KB | naxoc |
#12 | system-admin-custom-logo-901724-12.patch | 874 bytes | dixon_ |
#9 | system-admin-custom-logo-901724-2.patch | 923 bytes | fabsor |
#5 | system-admin-custom-logo-901724-1.patch | 649 bytes | bobodrone |
Comments
Comment #1
bobodrone CreditAttribution: bobodrone commentedI found out that first of all it have not set the "file_public_path" (which set the current files directory in the variable table) when you install a clean Drupal 7 installation but most important of all the form where you upload the custom logo should return the filepath relative to default files folder instead of just the filename in the field where your logos filename is shown.
This patch solves this by prepend the "default files path" to the uploaded logo when it prints it to the custom logo field in the form.
Comment #2
bobodrone CreditAttribution: bobodrone commentedchanged >>> 7.x-dev
Comment #3
bobodrone CreditAttribution: bobodrone commentedand changed >>> system.module
Comment #5
bobodrone CreditAttribution: bobodrone commentedRenamed my first core 7 patch, now I'm trying to follow the naming convention.
Sorry for that!
/ BoboDrone
Comment #6
mariusz.slonina CreditAttribution: mariusz.slonina commentedsub
Comment #7
bobodrone CreditAttribution: bobodrone commentedI think this bug is pretty serious since all logos will disappear the second time you post the theme settings form of any reason (if not have set file_public_path before manually)
Therefore I change this to major.
/ Bobodrone
Comment #8
dixon_The Drupal 7 release party in Gothenburg by NodeOne will update, test and review this patch so we hopefully can mark this as RTBC tonight.
Comment #9
fabsor CreditAttribution: fabsor commentedHi!
The patch looks fine apart from that the trailing slash should not be in the default value, this way, the file public path is the same as in other places in core.
Comment #10
logaritmisk CreditAttribution: logaritmisk commentedI have tried the patch by fabsor and it works.
Comment #11
logaritmisk CreditAttribution: logaritmisk commentedOups, forgot to change status :/
Comment #12
dixon_Small offset. Re-rolled patch. Still works perfectly.
Comment #13
webchickI would really love to see us add a test for this so it doesn't end up happening again.
Comment #14
naxoc CreditAttribution: naxoc commentedHere is a test for that.
Comment #15
grndlvl CreditAttribution: grndlvl commentedConfirmed system-admin-custom-logo-901724-12.patch fixes issue.
Confirmed 901724-14.patch(test case only) correctly detects issue before system-admin-custom-logo-901724-12.patch is applied and Passes successfully with system-admin-custom-logo-901724-12.patch applied.
Test seems to be sufficient for detecting this issue.
Comment #17
naxoc CreditAttribution: naxoc commentedWeird. I can't make the test fail on my machine. Try again, bot!
Comment #18
naxoc CreditAttribution: naxoc commented#14: 901724-14.patch queued for re-testing.
Comment #20
fabsor CreditAttribution: fabsor commentedTests looks fine to me, and I can't reproduce this locally either. I will try to investigate further.
Comment #21
fabsor CreditAttribution: fabsor commented#14: 901724-14.patch queued for re-testing.
Comment #23
naxoc CreditAttribution: naxoc commented#14: 901724-14.patch queued for re-testing.
Comment #25
sunSeriously, don't we have an existing helper function for this...?
I really hope so, but I'm not very familiar with D7's File API yet.
Powered by Dreditor.
Comment #26
sunRelated: #1087250: Custom logo and favicon stored in private filesystem if it is the default
Comment #27
pillarsdotnet CreditAttribution: pillarsdotnet commentedHow about
$logo_path = drupal_realpath('public://') . '/' . file_uri_target($logo_path);
Comment #28
sun#1376166: Custom logo and favicon functionality inanely tries to support absolute local file paths will likely make this issue obsolete.
Comment #29
catch#1376166: Custom logo and favicon functionality inanely tries to support absolute local file paths was committed to 8.x, and is in the process of being backported to 7.x.
I'm uploading just naxoc's test for this issue by itself, if that passes we can either combine the tests with the other issue, or if similar coverage was added elsewhere, just close this one.
Comment #31
naxoc CreditAttribution: naxoc commentedClosing. There is a test in #1376166: Custom logo and favicon functionality inanely tries to support absolute local file paths now.