Problem/Motivation

Currently, if a theme does not have a favicon, it will use the favicon from Drupal core. This is unlikely to be what is desired for a sub-them. A sub-theme ought to be able to get its favicon from its base theme.

Proposed resolution

When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used.

Remaining tasks

Implement.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Issue fork drupal-442814

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

effulgentsia’s picture

Category: feature » bug

Agreed. Anyone up for writing the patch for this?

effulgentsia’s picture

Title: subtheme favicon.ico » When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used

.

aspilicious’s picture

I wonna try this. Couple of questions.

1) what is the base theme? Garland?
2) Do i have to make the dirname hardcoded or is their a variable $base_theme or something like that?
3) What is the output of $theme_object->filename, if the filename is "test"

themes/test

or

test

pasqualle’s picture

1. does not matter
2. no
3. does not matter

if you want to try just create a sub-theme without a favicon, where the base theme has favicon.

read: http://drupal.org/node/171194
quick test:
1. create a sub theme (put "base theme = stark" into you theme .info file)
2. copy custom favicon.ico into stark folder
3. enable your sub-theme

aspilicious’s picture

I wonna try this. Couple of questions.

This means I wonna try to patch it XD.
I needed the answers to write a patch

pasqualle’s picture

If you would like to write a patch, then you first need to reproduce the problem.
you can use php functions print_r() or var_dump() or if you enable the devel module then dsm() to see the value of any variable.

dvessel’s picture

This should be fixed first #761608: Missing theme settings values because list_themes() has inconsistent theme object data so it can be worked through the 'base_themes' data.

deetergp’s picture

Status: Active » Needs review
StatusFileSize
new694 bytes

Since it has been a couple years since the last update to this ticket, I thought I might take a crack at this.

I downloaded Zen, threw a custom favicon in it, then created my own sub-theme, which was basically just a .info file and a different custom favicon. I went through theme.inc with a debugger and made my changes and then removed the favicon from my subtheme. Once removed, It defaulted to the custom favicon I had set for Zen.

Please have a look and let me know what you think.

Status: Needs review » Needs work

The last submitted patch, drupal-base_favicon-442814-8.patch, failed testing.

deetergp’s picture

StatusFileSize
new730 bytes

Alright, that one failed. I changed it and ran SimpleTest locally and the tests all passed. Hopefully TestBot will agree…

deetergp’s picture

Status: Needs work » Needs review
deetergp’s picture

Version: 7.x-dev » 8.x-dev
StatusFileSize
new1.57 KB

I was told that attention wouldn't be given to this patch unless it was checked and addressed in Drupal 8. After digging around a bit in D8 and learning about how to make subthemes, I discovered that this behavior still exists. The attached patch is the D8 version. I will re-roll the D7 patch so that it more closely resembles its D8 counterpart. Stay tuned.

deetergp’s picture

StatusFileSize
new1.4 KB

This is the re-rolled version of the D7 patch. I declared $base_theme and added to the existing inline comments about the favicon to make it resemble the D8 version of the patch. Please disregard the D7 patch in comment in #442814-10: When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used.

Status: Needs review » Needs work

The last submitted patch, drupal7-default_favicon-442814-13.patch, failed testing.

deetergp’s picture

Status: Needs work » Needs review
deetergp’s picture

Status: Needs work » Needs review

Haha… Okay I was scratching my head to figure out why TestBot was telling me that the patch wouldn't apply, when I could apply it just fine locally. Turns out… Now that I have changed the version for this ticket to 8.x-dev, it's going to try to apply the patch to that version. I am going to open a separate ticket for the D7 fix, post the patch to it and then append the link to that ticket to this one.

Ignore any other patches but the Drupal 8 version posted in #442814-12: When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used. The Drupal 7 version of this patch can be found at #2093955: When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used (7.x).

Status: Needs review » Needs work

The last submitted patch, drupal7-default_favicon-442814-13.patch, failed testing.

deekayen’s picture

Status: Needs review » Needs work

@deetergp the latest patch is what gets considered. having a D7 patch on a D8 issue will cause the bot to keep switching this back to needs work, which will make it hard for someone to know to test and RTBC it.

See also https://drupal.org/node/332678#versions

deetergp’s picture

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

@deekayen As I understand it, all I need to do in this situation is re-post the D8 patch so that it is the latest/most-recent one in the chain, and then TestBot will review it and leave the ticket in a state of "Needs review". I talked that through with @shrop and he seems to agree that would be the best course of action.

Status: Needs review » Needs work

The last submitted patch, drupal8-default_favicon-442814-19.patch, failed testing.

deetergp’s picture

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

This is getting ridiculous…

Re-rolled, re-tested locally, this should do it, and if it doesn't, I'm taking a break from this for a bit.

dcam’s picture

Issue summary: View changes

Closed #2093955: When a subtheme does not have favicon.ico, then the favicon.ico from the base theme should be used (7.x) as a duplicate. The other issue was created to attempt to backport the changes to 7.x quicker. It contains a 7.x patch that may be used as a starting point for when this issue gets to the backport stage.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

With this change, does that mean a subtheme would have to provide a favicon to override the base theme's favicon? It seems like there should at least be a way for a subtheme to declare it doesn't want to use the base theme's favicon.

rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.56 KB
mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
druprad’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.66 KB

patch re-rolled for comment #24

druprad’s picture

StatusFileSize
new1.66 KB

Corrected file name with respective comment.

joelpittet’s picture

Status: Needs review » Needs work

This seems like a good idea overall. Maybe this should be going through a loop till it finds one incase there are more than one base theme to cover this fully?

Jeff Burnz’s picture

Category: Bug report » Feature request

Sorry Joel but I don't agree, I think this is a bad idea unless the concerns raised in #23 are solved. Sub themes should definitely not inherit base theme favicon just because.

There is no bug here, this is feature request.

joelpittet’s picture

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

@Jeff Burnz a good point, thanks, a bit of a late night triage didn't look at comments, only code;)
Since it's a feature request I'll be bumping to 8.1.x.

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

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now 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.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now 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.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now 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.

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.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

liam morland made their first commit to this issue’s fork.

liam morland’s picture

Status: Needs work » Needs review

Merge request created based on the patch in #27.

To address #23, perhaps it ought to be possible set a variable in the info file such as favicon: false to indicate that no favicon is to be used.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update, +Needs tests

Think it will need simple test coverage

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

liam morland’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Re-rolled.

Are there currently tests for favicon.ico? I can't find any that test for a theme's favicon.ico.

neptune-dc made their first commit to this issue’s fork.

neptune-dc’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

We already have ThemeSettingsTest, we should work on extending that vs a new file. Also the test doesn't fully look inline with existing test structure is there an example of that?