Problem/Motivation

The implementation

/**
 * Implements hook_html_head_alter().
 */
function omega_html_head_alter(&$head) {
  // Simplify the meta tag for character encoding.
  $head['system_meta_content_type']['#attributes'] = array(
    'charset' => str_replace('text/html; charset=', '', $head['system_meta_content_type']['#attributes']['content']),
  );
}

in combination with the default html.tpl.php leads to invalid HTML markup if

if (omega_extension_enabled('compatibility') && omega_theme_get_setting('omega_conditional_classes_html', TRUE)):

in the template return true.

You can reproduce this when validating a site meeting the mentioned conditions with the W3C validator at http://validator.w3.org/check.

The validator will output the following message:

Proposed resolution

Add the opposite condition of the one in the template within omega_html_head_alter to prevent altering of the tag if conditional classes are added to the markup (which would push the tag out of the first 512 bytes).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

s_leu’s picture

Issue summary: View changes
s_leu’s picture

Status: Active » Needs review
FileSize
1010 bytes

Here's a first patch that adds the corresponding condition.

s_leu’s picture