Problem/Motivation

Drupal 8

1. Install 8.9
2. Install Garland (contributed theme)
3. Set Garland as default theme
4. Adjust colors and look at preview
5. Preview matches colors chosen except Header top and Header bottom
6. Save
7. View home page and look at header
8. None of the chosen colors are shown (different bug than this issue)

TBD if this is an issue with the color module or with the contributed Garland theme.

Note that the colors appear to work fine with Bartik.

Drupal 7

While testing #14 in #776684: The color.module preview HTML is hardcoded I found the following behavior when choosing color header top and bottom in the Garland theme.

1. Enable color module
2. In Garland settings choose a header top and header bottom color paying attention to what preview.png looks like
3. Save
4. Gradient is different from preview

I'm not sure if this is a 6.x issue. I don't use color.module much.

Proposed resolution

Drupal 8

See below:

Drupal 7

See comment #1 by @webchick for a start of a patch. May be some documentation changes depending on Drupal 8 resolution.

Remaining tasks

  • Update issue summary with problem & resolution/approach for Drupal 8 after reviewing color module behavior.
  • Write patch for Drupal 8
  • Manually test patch for Drupal 8
  • Write a beta evaluation
  • Determine fix for Drupal 7
  • Write a patch for Drupal 7 Garland theme
  • Manually test patch for Drupal 7

User interface changes

Color preview will match the colors chosen with the color options.

API changes

N/A

Only local images are allowed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

This might be the start of a patch...

-            delta[j] = (color_end[j] - color_start[j]) / (settings.gradients[i]['vertical'] ? height[i] : width[i]);
+            delta[j] = (color_end[j] - color_start[j]) / (settings.gradients[i]['vertical'] ? height[i] : width[i]) * 10;
tim.plunkett’s picture

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

Hopefully something can be backported.

markhalliwell’s picture

Issue tags: +Novice, +Issue needs confirmation, +Needs manual testing

tagging

balsama’s picture

Issue tags: -Novice, -Issue needs confirmation, -Needs manual testing
FileSize
143.62 KB

Garland isn't available in D8, so I tested this with Bartik and could not reproduce it. Screenshots below:

color-module-test.png

markhalliwell’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: -Needs backport to D7 +Novice, +Issue needs confirmation, +Needs manual testing

Thanks @balsama! Feeling like Christmas already hehe

Alright, since 8.x is fine, let's bump this down to 7.x. Added tags back, I would like to see the same type of wonderful manual testing in 7.x for both Garland/Bartik. It may be theme and not color.module specific.

balsama’s picture

Status: Active » Needs review
FileSize
606 bytes
11.15 KB
335.82 KB

It does seem to still be a problem with Garland:

color-module-test-d7.png

webchicks suggested patch above does affect Garland's preview, but it's unclear to me if this is the desired result since it's not really a gradient, but more like bands of color:

color-module-test-d7-after-patch.png

The attached patch does not affect D7 Bartik or the actual presentation (not the preview) of eithe Bartik or Garland.

oadaeh’s picture

Version: 7.x-dev » 8.0.x-dev
Assigned: Unassigned » oadaeh
Issue summary: View changes
Status: Needs review » Needs work

Probably the reason why it shows up for Garland and not Bartik is because they each use the Color module differently.
As of 7.x, the color module has two methods of manipulating the colors. One is strictly code based, which is what Bartik uses, and the other is image based, which is what Garland uses.
Not having Garland in 8.x and not being able to easily test it there does not mean this behavior is not present in 8.x.
I will see what I can do to figure this out.
Moving back to 8.x.

oadaeh’s picture

oadaeh’s picture

I guess this issue is also dependent on #2380643: Garland breaks whenever the colors are changed even though that's in contrib space.

mgifford’s picture

Assigned: oadaeh » Unassigned

There has been no new work on this issue in quite some time. So I'm assuming the person assigned is no longer being actively pursuing it. Sincere apologies if this is wrong.

ragnarkurm’s picture

Cannot reproduce the bug on 8.x-dev on Bartik.
This is only standard theme that uses Colors module.
Changed all colors.
They appear correctly on preview and in theme in action.
I assume this not problem for 8.x.

oadaeh’s picture

@ragnarkurm, please see my comment #7. It is only not a bug for Bartik, because Bartik doesn't use the code that causes the behavior. It is still potentially a bug for Drupal, because the code does exist, but I can't test, prove (or disprove) and fix it, until the issue I linked to in #8 is fixed.

ragnarkurm’s picture

Sorry, I was too quick on this.
I spent some hours on #8 issue, hopefully it will get resolved soon.

alexpolicastro’s picture

I am at drupalconla and am going to try to replicate the issue.

alexpolicastro’s picture

Assigned: Unassigned » alexpolicastro
alexpolicastro’s picture

I also could not reproduce this problem. Just like others have pointed out Garland has been removed from Drupal 8 Core. From the Garland page "Garland was removed from Drupal core as of Drupal 8 as part of the Platform Initiative."

I am recommending we remove this from the Drupal 8 Core bugs.

alexpolicastro’s picture

Status: Needs work » Closed (won't fix)
oadaeh’s picture

Status: Closed (won't fix) » Active

Just because Garland is not in core, does not mean core's behavior is not broken and should not be fixed.

alexpolicastro’s picture

Sorry about that, if I'm pretty new at this but then shouldn't it be removed as a Drupal 8 Core issue? As its not in core?
(Only set it to closed as recommended by my DrupalCon mentor)

mradcliffe’s picture

Assigned: alexpolicastro » Unassigned
Priority: Normal » Minor
Issue summary: View changes
Issue tags: -Issue needs confirmation, -D7UX usability +Needs issue summary update

I think the issue summary is in need of an update as I originally wrote up the issue for Drupal 7, and we're looking into the bug in Drupal 8 color module and its implementations.

I added the issue summary template, but the next step would be to look into color module behavior in Drupal 8, and see if a theme can botch the implementation of the gradient like Garland. Perhaps this is a documentation update for Drupal 8 and a fix for Drupal 7?

Cleaned up some tags and downgraded to Minor for Drupal 8, but probably a Normal issue for Drupal 7.

I hope that helps clarify what the next steps are if you want to continue working on this issue, @alexpolicastro.

kfitz’s picture

I've been looking into the cause of this issue, and it's caused by Garland using module.color.color.js to render the preview. The Bartik Theme uses the '-webkit-gradient' or '-moz-linear-gradient' method for rendering the gradient. Garland, on the other hand, taps into the functionality of module.color.js and the result is to produce a preview that is not representative of the resultant header gradient.

I am pretty sure the preview that is produced is not a bug in the sense of something being broken, as it appears the color.js is producing the preview it's programmed to. The approach is to produce 10 div's with incrementing id attributes, i.e. "id='gradient-x'", and slightly adjust the colour spectrum values from the top header colour selection to the bottom for each div.

I can get the Garland Theme Preview to successfully render using the same approach as the Bartik Theme, i.e using '-webkit-gradient' or '-moz-linear-gradient' to do the job:

https://www.drupal.org/files/issues/garland-webkit-rendered-preview_1.png

https://www.drupal.org/files/issues/garland-header-actual.png

Note that neither the Bartik or Garland Themes previews render properly in IE8 or IE9, but do work in IE10.

My recommendation would be to refactor the Garland Theme to use the same approach as the Bartik theme for rendering the header preview. I believe I could create the patch for this with out too much difficulty.

kfitz’s picture

mradcliffe’s picture

Nice work, @kfitz. I assume that the lack of IE8 support is still a bug because Drupal 7 supports IE8 although a minor bug because it could be worked around. It's probably up to the maintainer whether or not the patch should be required to modify the IE stylesheet or not.

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.

cilefen’s picture

Issue tags: -Novice

There doesn't seem anything immediately actionable by a novice.

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.

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

Kristen Pol’s picture

Issue tags: +Bug Smash Initiative

Triaging for Bug Smash Initiative.

Kristen Pol’s picture

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

Looking through the comments, I see that several contributors have tried to bump down this issue from D8 to D7 but it continues to be moved back to a D8 issue even though no one can reproduce the issue on D8. I understand that this may, in principle, be an issue within D8 but given 1) no one can reproduce it and 2) the age of this issue, I would again bump this issue down to D7. I will double check with the bugsmash team on this but IMO it makes sense.

Kristen Pol’s picture

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

Feedback from xjm (copied with permission):

If the image-based color manipulation still exists, it'd need to be fixed in core. The manual testing steps I'd suggest would be to test contrib Garland with 8.9.x to see if the core bug still exists.
Like is the code Angie shows in #1 still there? If so, and if it is still off by a factor of 10, that is still technically a core bug and marginal contrib blocker even if core themes don't exercise that code path.

so bumping back to 8.9 for testing with Garland again to see if it's still an issue.

Kristen Pol’s picture

I've tested Garland on 8.9 and see the issue with color not changes in the preview for Header top and Header bottom but works for the other colors. But the site isn't showing the colors at all for Garland even after clearing the cache. All the colors for Bartik seem to be working. See screenshots. I've updated the issue summary.

Garland:

Settings & Preview:

Home Page:

Bartik:

Settings:

Preview:

Home Page:

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

quietone’s picture

Project: Drupal core » Color backport
Version: 9.4.x-dev » 2.x-dev
Component: color.module » Code

Color has been removed from core, #3270899: Remove Color module from core.