Problem/Motivation

<h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>

on file ../modules/block/block.tpl.php

This is can printing all attached attributes on h2 tag

Proposed resolution

<h2 <?php print $title_attributes; ?>><?php print $block->subject ?></h2>

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Thalles created an issue. See original summary.

thalles’s picture

StatusFileSize
new480 bytes

Flollow pacth!

thalles’s picture

Status: Needs work » Needs review
akshay.kelotra’s picture

Status: Needs review » Reviewed & tested by the community

I have tested and seems to work fine.

jacob.embree’s picture

Title: D7:php tag attached to html » [D7] php tag attached to html
Component: block.module » markup
Assigned: thalles » Unassigned
Status: Reviewed & tested by the community » Active
Issue tags: -#ciandt-contrib

Can we see an example where this is a problem before the patch?
I suspect that this is not a bug because the same pattern of mashing the <php tag against the preceding tag exists at least in the following files:

  • comment/comment.tpl.php
  • node/node.tpl.php
  • overlay/overlay.tpl.php
  • search/search-result.tpl.php

Unassigning Thalles.
Moving to markup component because the issue affects templates from multiple modules.

ajaybmishra’s picture

StatusFileSize
new7.33 KB

Correction is made in Drupal core modules templates files listed below.

  • comment/comment.tpl.php
  • node/node.tpl.php
  • overlay/overlay.tpl.php
  • search/search-result.tpl.php
  • comment/comment-wrapper.tpl.php
  • field/theme/field.tpl.php
  • user/user-profile-category.tpl.php
  • /user/user-profile-item.tpl.php

Patch attached.

ajaybmishra’s picture

Status: Active » Needs review
thomas.feichter’s picture

Patch from #6 seems to work fine.

However, I also was not able to actually reproduce a problem with the unpatched version.
I tested it with a block and the block_attributes module but the HTML seems fine.

<h2 class="title-test-class" id="title-test-id" style="font-size:20px;">Test</h2>

Is there any way to reproduce the initial problem you encountered?

thalles’s picture

Status: Needs review » Closed (works as designed)

Hi, sorry, the drupal add space in function on includes/common.inc

function drupal_attributes(array $attributes = array()) {
  foreach ($attributes as $attribute => &$data) {
    $data = implode(' ', (array) $data);
    $data = $attribute . '="' . check_plain($data) . '"';
  }
  return $attributes ? ' ' . implode(' ', $attributes) : '';
}

Sorry!

ajaybmishra’s picture

Hello thomas.feichter,

It was just coding standard issue for templates files, it will not affect any functionality for blocks.

@thalles: Thanks for your valuable updates.