If I replace the logo.png in the theme folder, I must go into appearance and save the settings again.

This is due to that the logo.png is copied to files/color/bartik-[random]

Only way to get the new logo to show is to go to appearance and save the settings. Then it will show properly.

Comments

Jeff Burnz’s picture

This happens because logo is specified in color.inc

  // Files to copy.
  'copy' => array(
    'logo.png',
  ),

There may be some thinking behind this, or its an oversight/legacy code, will await what Jen says.

jensimmons’s picture

So color module is taking over the ability to upload custom logos? That sounds bad. Let's test more, and let's fix it.

jensimmons’s picture

Project: Bartik » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Code » Bartik theme
Issue tags: +color module
tim.plunkett’s picture

Category: support » bug
Priority: Normal » Major

I need to take a longer look at this, but it's actually a pretty big problem. Couldn't figure it out right away.

Jeff Burnz’s picture

Component: Bartik theme » color.module
Status: Active » Needs review
StatusFileSize
new2.42 KB

Cant we just add a bit of checking to color module?

aspilicious’s picture

I didn't had to do this?
Just tried it...
Very recent dev checkout.

bleen’s picture

@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.

aspilicious’s picture

I manually swap the image on my local computer. Running through localhost. Image gets swapped immediately on the screen with a reload.

Jeff Burnz’s picture

I 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.

tim.plunkett’s picture

The 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.

Jeff Burnz’s picture

#10 - I see that also - is that really a problem, what would be the purpose of it getting copied to the new color set?

tim.plunkett’s picture

Currently, 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.

Jeff Burnz’s picture

I 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.

tim.plunkett’s picture

Turns out my problem was separate problem due to PHP 5.2: #924396: _system_theme_settings_validate_path() fails on PHP 5.2.

sun.core’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Trying to make any sense of the major queue currently. This sounds like an annoying bug, but not major.

+++ modules/color/color.module	20 Aug 2010 22:54:30 -0000
@@ -345,12 +345,14 @@
+  if (isset($info['copy'])) {
+    foreach ($info['copy'] as $file) {

Color module should default $info['copy'] to an empty array.

Powered by Dreditor.

webchick’s picture

Priority: Normal » Major

I 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.

webchick’s picture

Priority: Major » Normal
StatusFileSize
new1.7 KB

Hm. 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.

tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: -color module +Needs backport to D7

I believe this is still relevant.

markhalliwell’s picture

Issue tags: +Needs reroll

Personally 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).

markhalliwell’s picture

Marked #109342: Allow color module to re-color logos as a dup of this issue.

t14’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

Did a re-roll, tested and working

t14’s picture

StatusFileSize
new154.65 KB
new127.42 KB

Tested 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

rteijeiro’s picture

Status: Needs review » Needs work
+++ b/core/modules/color/color.module
@@ -94,7 +94,7 @@ function color_preprocess_page(&$variables) {
+   if (file_exists($logo) && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) {

Fix indentation. It seems to have one blank space at the beginning.

t14’s picture

StatusFileSize
new1.72 KB

using correct coding standards

t14’s picture

Status: Needs work » Needs review
rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community

Tested #24 patch and works like a charm. It looks like a RTBC ;)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, color-819222-24.patch, failed testing.

markhalliwell’s picture

Issue tags: -Needs reroll
  1. +++ b/core/modules/color/color.module
    @@ -353,12 +353,14 @@ function color_scheme_form_submit($form, &$form_state) {
    +  if (isset($info['copy'])) {
    

    Per @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! :)

t14’s picture

Status: Needs work » Needs review

#24: color-819222-24.patch queued for re-testing.

markhalliwell’s picture

Status: Needs review » Needs work

The review I did in #28 still needs to happen.

t14’s picture

Status: Needs work » Needs review
StatusFileSize
new989 bytes

re-roll with regards to comment #28

Status: Needs review » Needs work

The last submitted patch, color-819222-31.patch, failed testing.

markhalliwell’s picture

@t14, your patch got reversed somehow. This is why the patch failed.

  • +++ b/core/modules/color/color.module
    @@ -94,7 +94,7 @@ function color_preprocess_page(&$variables) {
    -  if (file_exists($logo) && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) {
    +  if ($logo && $variables['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $variables['logo'])) {
    

    This should be adding the file_exists(), not taking it out (which doesn't exist in core).

  • +++ b/core/themes/bartik/color/color.inc
    @@ -100,6 +100,11 @@
    +  // Files to copy.
    +  'copy' => array(
    +    'logo.png',
    +  ),
    +
    

    This should be removed, not added.

  • t14’s picture

    Status: Needs work » Needs review
    StatusFileSize
    new1.01 KB

    Not sure what happened with the last one here is a fresh patch.

    Status: Needs review » Needs work

    The last submitted patch, color-819222-34.patch, failed testing.

    t14’s picture

    does this require something like?

    $info['copy'] = '';
    
    markhalliwell’s picture

    +++ b/core/themes/bartik/color/color.inc
    @@ -100,11 +100,6 @@
    -  // Files to copy.
    -  'copy' => array(
    -    'logo.png',
    -  ),
    -
    

    This should just be:
    'copy' => array(),

    t14’s picture

    StatusFileSize
    new1 KB
    markhalliwell’s picture

    Status: Needs work » Needs review

    Go bot go

    jhedstrom’s picture

    Issue summary: View changes
    Status: Needs review » Needs work
    Issue tags: +Needs reroll
    rpayanm’s picture

    Status: Needs work » Needs review
    Issue tags: -Needs reroll
    StatusFileSize
    new983 bytes

    mgifford queued 41: 819222-41.patch for re-testing.

    Status: Needs review » Needs work

    The last submitted patch, 41: 819222-41.patch, failed testing.

    Version: 8.0.x-dev » 8.1.x-dev

    Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

    Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.1.x-dev » 8.2.x-dev

    Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

    Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.2.x-dev » 8.3.x-dev

    Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

    Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.3.x-dev » 8.4.x-dev

    Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

    Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.4.x-dev » 8.5.x-dev

    Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

    Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.5.x-dev » 8.6.x-dev

    Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

    Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    andypost’s picture

    Version: 8.6.x-dev » 8.7.x-dev
    Status: Needs work » Needs review
    Issue tags: +Needs tests
    StatusFileSize
    new1.08 KB

    reroll

    Version: 8.7.x-dev » 8.8.x-dev

    Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

    Version: 8.8.x-dev » 8.9.x-dev

    Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

    Version: 8.9.x-dev » 9.1.x-dev

    Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

    Version: 9.1.x-dev » 9.2.x-dev

    Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

    Version: 9.2.x-dev » 9.3.x-dev

    Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

    quietone’s picture

    Version: 9.3.x-dev » 7.x-dev
    Issue tags: +Bug Smash Initiative

    I 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.

    d70rr3s’s picture

    I 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.

    Status: Needs review » Closed (outdated)

    Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.