At about line 637 of color.module are these lines:

  // Cut out slices.
  foreach ($info['slices'] as $file => $coord) {

The Color module uses filenames as the keys of an array that specifies images slices.

Dots in array keys have been banned in 8.x. This issue #2293773: Field allowed values use dots in key names - not allowed in config and change record Dots are explicitly forbidden in configuration data keys now explain the situation.

The behavior can be seen in the Garland theme's color/color.inc file, starting at about line 192:

  // Coordinates of all the theme slices (x, y, width, height)
  // with their filename as used in the stylesheet.
  'slices' => array(
    'images/body.png'                      => array(0, 37, 1, 280),
    'images/bg-bar.png'                    => array(202, 530, 76, 14),
    'images/bg-bar-white.png'              => array(202, 506, 76, 14),
    'images/bg-tab.png'                    => array(107, 533, 41, 23),
    'images/bg-navigation.png'             => array(0, 0, 7, 37),
    'images/bg-content-left.png'           => array(40, 117, 50, 352),
    'images/bg-content-right.png'          => array(510, 117, 50, 352),
    'images/bg-content.png'                => array(299, 117, 7, 200),
    'images/bg-navigation-item.png'        => array(32, 37, 17, 12),
    'images/bg-navigation-item-hover.png'  => array(54, 37, 17, 12),
    'images/gradient-inner.png'            => array(646, 307, 112, 42),

    'logo.png'                             => array(622, 51, 64, 73),
    'screenshot.png'                       => array(0, 37, 400, 240),
  ),

Changing the color scheme of a theme that uses the color module in this way generates an error message similar to this:

Error
Status message
The configuration options have been saved.
The website has encountered an error. Please try again later.

and a watchdog log message similar to this:

Drupal\Core\Config\ConfigValueException: images/body.png key contains a dot which is not supported. in Drupal\Core\Config\ConfigBase->validateKeys() (line 217 of /path/to/drupal/8.0.x/core/lib/Drupal/Core/Config/ConfigBase.php).

Some re-architecting will need to be done in that function to come up with a way of specifying filenames without using dots.

Files: 
CommentFileSizeAuthor
#5 2380641_warnings.png290.34 KBpjonckiere
#4 color_module_image_method-2380641-4.patch1.24 KBoadaeh
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,406 pass(es). View
#2 color_module_image_method-2380641-2.patch1.22 KBoadaeh
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,434 pass(es). View

Comments

oadaeh’s picture

Assigned: Unassigned » oadaeh

I think I have an idea no how to fix this with a minimal amount of disruption.

oadaeh’s picture

Issue tags: +Needs tests
FileSize
1.22 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,434 pass(es). View

I've modified the module such that themes that use the color module in this way will have to modify their slices array so they look like this (using the Garland example above):

  // Coordinates of all the theme slices (x, y, width, height)
  // with their filename as used in the stylesheet.
  'slices' => array(
    array(
      'file' => 'images/body.png',
      'coord' => array(0, 37, 1, 280),
    ),
    array(
      'file' => 'images/bg-bar.png',
      'coord' => array(202, 530, 76, 14),
    ),
    array(
      'file' => 'images/bg-bar-white.png',
      'coord' => array(202, 506, 76, 14),
    ),
    array(
      'file' => 'images/bg-tab.png',
      'coord' => array(107, 533, 41, 23),
    ),
    array(
      'file' => 'images/bg-navigation.png',
      'coord' => array(0, 0, 7, 37),
    ),
    array(
      'file' => 'images/bg-content-left.png',
      'coord' => array(40, 117, 50, 352),
    ),
    array(
      'file' => 'images/bg-content-right.png',
      'coord' => array(510, 117, 50, 352),
    ),
    array(
      'file' => 'images/bg-content.png',
      'coord' => array(299, 117, 7, 200),
    ),
    array(
      'file' => 'images/bg-navigation-item.png',
      'coord' => array(32, 37, 17, 12),
    ),
    array(
      'file' => 'images/bg-navigation-item-hover.png',
      'coord' => array(54, 37, 17, 12),
    ),
    array(
      'file' => 'images/gradient-inner.png',
      'coord' => array(646, 307, 112, 42),
    ),
    array(
      'file' => 'logo.png',
      'coord' => array(622, 51, 64, 73),
    ),
    array(
      'file' => 'screenshot.png',
      'coord' => array(0, 37, 400, 240),
    ),
  ),

Patch attached.

I guess tests need to be created for this, since it wasn't caught before now.

oadaeh’s picture

Status: Active » Needs review
oadaeh’s picture

Assigned: oadaeh » Unassigned
FileSize
1.24 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,406 pass(es). View

Re-roll for recent changes. It still needs tests.

pjonckiere’s picture

Status: Needs review » Needs work
FileSize
290.34 KB

After applying your patch, I receive a lot of warnings. I suspect it's due to the changed structure.

Screenshot of the warnings attached.

oadaeh’s picture

@pjonckiere, I just applied the patch in comment #4 to the latest code in dev (just downloded), and I'm not getting those messages. Which theme are you using? What other changes did you make?

oadaeh’s picture

Status: Needs work » Needs review

Resetting to try to get a re-test.

ragnarkurm’s picture

Installed Garland (8.x-1.0-alpha6) on Drupal 8.x-dev.
After applying the #4 patch, got errors as mentioned by @pjonckiere in #5.
After fixing corresponding Garland data structure as in #2 got rid of errors.

Color module generated images are correct in files/colors/garland-xxxxxxxx/

I did not get custom colors shown in actual Garland-themed page,
Suspecting this is Garland issue rather than the Color module's.
I copied garland/css/style.css to garland/style.css and some custom colors appeared.

joachim’s picture

Garland hasn't yet been updated for D8 color module support -- partly because this issue isn't resolved yet, in fact.

borisson_’s picture

Status: Needs review » Needs work

Back to needs work as tests still need to be added.

catch’s picture

Issue tags: +Configuration system
lokapujya’s picture

cannot reproduce the error.

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.

Wim Leers’s picture

Status: Needs work » Closed (cannot reproduce)

When changing the color scheme of the Bartik theme, I cannot reproduce this:

Drupal\Core\Config\ConfigValueException: images/body.png key contains a dot which is not supported. in Drupal\Core\Config\ConfigBase->validateKeys() (line 217 of /path/to/drupal/8.0.x/core/lib/Drupal/Core/Config/ConfigBase.php).