Problem: Empty RDF tags are printed:

// Add RDF type and about URI.
  if (module_exists('rdf')) {
    $variables['attributes_array']['about'] = empty($uri['path']) ? NULL: url($uri['path']);
    $variables['attributes_array']['typeof'] = empty($entity->rdf_mapping['rdftype']) ? NULL : $entity->rdf_mapping['rdftype'];
  }

Solution: Do not set these at all when the values are NULL.

Comments

ytsurk’s picture

Issue summary: View changes

changed php to code

ytsurk’s picture

Issue summary: View changes

clarification

ytsurk’s picture

Title: markup issue: double class attribute » markup issues: w3c validation
ytsurk’s picture

the doubled class attribute (1) is caused by the omega theme ...
#1911204: class attribute of entity wrapper div is printed twice

/**
 * Implements hook_preprocess().
 */
function alpha_preprocess(&$vars, $hook) {
  $vars['attributes_array']['class'] = $vars['classes_array'];
  
  alpha_invoke('preprocess', $hook, $vars);
}

thx to @berdir

RDF still should be fixed

ytsurk’s picture

Status: Active » Needs review
StatusFileSize
new752 bytes

here the patch, setting the properties only if !empty, removed the NULL setter.

ytsurk’s picture

StatusFileSize
new757 bytes

sorry - missed the url() method

ytsurk’s picture

Issue summary: View changes

enhanced

chris matthews’s picture

Version: 7.x-1.0-rc3 » 7.x-1.x-dev
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch in #4 to entity.module does not apply to the latest entity 7.x-1.x-dev.

Checking patch entity.module...
error: while searching for:

  // Add RDF type and about URI.
  if (module_exists('rdf')) {
    $variables['attributes_array']['about'] = empty($uri['path']) ? NULL: url($uri['path']);
    $variables['attributes_array']['typeof'] = empty($entity->rdf_mapping['rdftype']) ? NULL : $entity->rdf_mapping['rdftype'];
  }

  // Add suggestions.

error: patch failed: entity.module:1055
error: entity.module: patch does not apply
ytsurk’s picture

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

Here the re-rolled patch.

ytsurk’s picture

Issue summary: View changes
liam morland’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Looks good.

  • TR committed 1c3aaa4 on 7.x-1.x
    Issue #1910596 by ytsurk: markup issues: w3c validation
    
tr’s picture

Status: Reviewed & tested by the community » Fixed

Committed #6. Thank you for your persistence @ytsurk!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.