Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
color.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2010 at 19:40 UTC
Updated:
16 Jul 2021 at 21:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Jeff Burnz commentedThis happens because logo is specified in color.inc
There may be some thinking behind this, or its an oversight/legacy code, will await what Jen says.
Comment #2
jensimmons commentedSo color module is taking over the ability to upload custom logos? That sounds bad. Let's test more, and let's fix it.
Comment #3
jensimmons commentedComment #4
tim.plunkettI need to take a longer look at this, but it's actually a pretty big problem. Couldn't figure it out right away.
Comment #5
Jeff Burnz commentedCant we just add a bit of checking to color module?
Comment #6
aspilicious commentedI didn't had to do this?
Just tried it...
Very recent dev checkout.
Comment #7
bleen commented@aspilicious ... did you manually just swap out the logo.png (via ftp or whatever) or did you use the appearance settings? The OP is about manually swapping the image.
Comment #8
aspilicious commentedI manually swap the image on my local computer. Running through localhost. Image gets swapped immediately on the screen with a reload.
Comment #9
Jeff Burnz commentedI think part of the weirdness is that you have to have the copy array declared in color.inc - you will get an undefined notice if you try to remove it or leave it empty - and that the color module wants to override the logo by default.
The patch...
1) checks that a new logo file exists before overriding the default
2) checks the $info['copy'] isset before trying to copy over neutral images
Which means themes can choose to declare the copy array or not - its just an idea and needs some review from the color module peeps.
Comment #10
tim.plunkettThe OP is about manually replacing logo.png, but I have related problem. If you set a custom logo, save it, and then recolor the theme, it does not copy the logo to the new color set.
Comment #11
Jeff Burnz commented#10 - I see that also - is that really a problem, what would be the purpose of it getting copied to the new color set?
Comment #12
tim.plunkettCurrently, it is uploaded the active color set. When the color set is changed, it isn't moved, but the new color set assumes it has been, and you get a missing image.
In a custom theme, it normally gets copied straight to the theme's directory, but that's not an option with a core theme, so it puts it with the color set.
It either needs to be copied to the color set, or put somewhere else that the color set can reference.
Comment #13
Jeff Burnz commentedI can't agree that #12 is a problem - this would be an edge case since it would be silly to load your logo into the color set when you have an upload form on the theme settings page to add your custom logo, which gets saved to the files directory. If you add your logo to the color set and it disappears when you change color schemes - too bad.
Can we look at #5 again, right now Bartik is copying this image (the logo) to the color set simply to avoid an error for something that should not be a hard requirement.
Garland will be doing this also when we change the logo to a transparent png to fix the alignment issues - so both core colorable themes will be hacking their way around color module.
Comment #14
tim.plunkettTurns out my problem was separate problem due to PHP 5.2: #924396: _system_theme_settings_validate_path() fails on PHP 5.2.
Comment #15
sun.core commentedTrying to make any sense of the major queue currently. This sounds like an annoying bug, but not major.
Color module should default $info['copy'] to an empty array.
Powered by Dreditor.
Comment #16
webchickI believe this is the issue I ran into today, and if so, it's major.
The symptoms are this:
1. Go to global theme settings (admin/appearance/settings) and upload a custom site logo (annoyingly, you have to uncheck "Use default" to even see that this is an option available to you).
2. Go to Bartik's theme settings (admin/appearance/settings/bartik). Note that you can switch color schemes around and the preview correctly shows them with the custom site logo.
3. Find a suitable colour scheme, then save.
Effect #1: The preview is broken and only shows site name, not site logo.
Effect #2: You also just broke the logo on your site, which is looking in the root directory for the logo, instead of the files directory.
This'll ultimately need to get fixed in D8 first and then back-ported, but leaving it in D7 for now to get some more eyes on it.
Comment #17
webchickHm. Patch doesn't seem to fix it, so I must have some other problem.
Here's a free re-roll, anyway. Doesn't include sun's suggestion.
Comment #18
tim.plunkettI believe this is still relevant.
Comment #19
markhalliwellPersonally I think this is part of a bigger issue (ie: having to save the settings for color to re-generate things to begin with... it should be cache controlled in reality).
But I agree... there should be some file watching (maybe even against file mod date?) to detect when a theme changes the logo. It should create a new colored version of the logo (upon cache clear, imho).
Comment #20
markhalliwellMarked #109342: Allow color module to re-color logos as a dup of this issue.
Comment #21
t14 commentedDid a re-roll, tested and working
Comment #22
t14 commentedTested against the steps in comment #819222-16: logo.png copied to files/color/... and will only be updated on new save
effect 1 and effect 2 were not experinced
screenshots attached
Comment #23
rteijeiro commentedFix indentation. It seems to have one blank space at the beginning.
Comment #24
t14 commentedusing correct coding standards
Comment #25
t14 commentedComment #26
rteijeiro commentedTested #24 patch and works like a charm. It looks like a RTBC ;)
Comment #28
markhalliwellPer @sun.core in #15, this should always be defined, at a minimum, an empty array. So this check isn't needed and should be removed.
Also, please don't RTBC a patch before it's at least come back from testing green (just to make sure no other regressions have been introduced), thanks! :)
Comment #29
t14 commented#24: color-819222-24.patch queued for re-testing.
Comment #30
markhalliwellThe review I did in #28 still needs to happen.
Comment #31
t14 commentedre-roll with regards to comment #28
Comment #33
markhalliwell@t14, your patch got reversed somehow. This is why the patch failed.
This should be adding the
file_exists(), not taking it out (which doesn't exist in core).This should be removed, not added.
Comment #34
t14 commentedNot sure what happened with the last one here is a fresh patch.
Comment #36
t14 commenteddoes this require something like?
Comment #37
markhalliwellThis should just be:
'copy' => array(),Comment #38
t14 commentedComment #39
markhalliwellGo bot go
Comment #40
jhedstromComment #41
rpayanmComment #50
andypostreroll
Comment #56
quietone commentedI tested this on Drupal 8.9.x and 9.3.x and cannot reproduce the problem. I added a custom logo, went to the site and saw it displayed correctly. Then copied a different logo to the same filename in sites/default/files, reloaded the home page and the logo was changed. The path to the logo is now in config and retrieved from there so there is no 'random' portion.
I have not tested Drupal 7. Moving back to the Drupal 7 issue queue.
Comment #57
d70rr3s commentedI don't think this is quite fixed yet. With 9.2 I after installed color module, and saved the settings if I change the logo in theme folder (not uploading it from the UI) the logo is not updated until I re-save the theme settings again. This is caused because the copy part is done as a submit callback on the theme settings form. I think is an issue because lets say, we start a project we set the theme settings, later during development we choose to change the logo. If we don't save again the settings the logo wil not be copied. Since the color module is altering the core site branding block should check first if the color version of the logo exists, if not leave the block unchanged.