Mitius generating broken code

+1
0
-1

This does not appear to be a common issue, but is more likely related to my particular installation.

Somewhere, a process is generating broken code for the time/date stamp for "Blog entry" articles. The code being generated is this:

<code>

<div class="published-date" title="<span property=" dc:date="" dc:created"="" content="2015-02-10T21:48:20-07:00" datatype="xsd:dateTime">Tue, 02/10/2015 - 21:48"&gt;
<span class="day">10</span>
<span class="month">Feb</span>
</div>

</code>

Screenshot shows the broken code on the right (from "Inspect Element" in Chrome) and the result on the left.

The error occurs in the first div tag, where it attempts (and apparently fails) to generate a title, and the tag is not closed.

This error occurs in the date stamp for Blog Entry items only - Article items display a properly-formatted date stamp.

I'm not sure if this error is coming from Drupal, the Mitius theme or one of the two dozen modules/plugins. It did not occur in other installations of Drupal/Mitius and seems to be isolated to this one - possibly a data-loss error during file uploads.

Which file would I edit to repair this error? Everything else seems to be working fine.

+1
0
-1

Hi J Sproul,

This code is not generated by TB Mitius theme. Have you modify the theme?

Kind regards,
Will

+1
0
-1

After finding help on Drupal's IRC channel, I think I've found the root cause.

The theme (I'm lead to believe it is part of the pre-process?) is setting the doctype to XHTML 1.0 Transitional, while the procedure generating the date stamp code is attempting to assign modifiers which are only appropriate for HTML5 to the div that contains the date code. According to the Drupal expert, the "title" attribute works fine with div tags in HTML5, but not in the XHTML version assigned by the theme.

My solution was to edit (root) / sites / all / themes / tb_mitius / tpl / node--blog.tpl.php and remove the attribute:

title="<?php echo $date?>"

from line 83. It now reads:

<div class="published-date">

This displays the date and month in a square block. Seems to be working fine.

If it is not the case that the theme sets the doctype, I apologize. But the problem is definitely that the code being generated does not conform to the doctype.