Bug #50566
closedMenu-links generate two empty spaces before closing angle bracket in source code
100%
Description
Enviroment:
TYPO3 CMS 6.1.2
php 5.4.10
MAMP 2
Mac OS X 10.7.5
Steps to reproduce the bug:
1. Fluid Template:
<div class="menu"><f:format.html>{MENU_MAIN}</f:format.html></div>
or
<div class="menu"><f:format.raw>{MENU_MAIN}</f:format.raw></div>
2. TypoScript:
lib.MENU_MAIN = HMENU
lib.MENU_MAIN {
extAll = 0
wrap = <ul>|</ul>
1 = TMENU
1 {
NO = 1
NO {
wrapItemAndSub = <li>|</li>
ATagTitle.field = title
}
ACT < .NO
ACT.wrapItemAndSub = <li class="active">|</li>
}
}
The generated source code looks like this:
<ul>
<li><a href="/index.php?id=16" title="KoFoMi 1-17" >KoFoMi 1-17</a></li>
<li><a href="/index.php?id=17" title="Symposien" >Symposien</a></li>
<li><a href="/index.php?id=18" title="Wohin?" >Wohin?</a></li>
</ul>
Rene-Ralf Schröder mentions that:
- this is also the case on the TYPO3 demo site:
http://introduction.typo3cms.demo.typo3.org/
- this does not happen on older 4.7 versions
- the 2 spaces are placed between title tag and class parameters, if there are any; in that case there are no gaps before the closing angle bracket.
Thanks to Rene-Ralf Schröder and Chris Wolff!
To my knowledge this kind of source code formatting will not be valid for A+++ (Government Package?), but I might be wrong here...
Updated by Patrick Schriner over 11 years ago
I tracked part of this bug.
Fluid is not at all to blame - the cause is (at least for normal menus) the function setATagParts() in \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject:
public function setATagParts() {
$this->I['A1'] = '<a ' . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeAttributes($this->I['linkHREF'], 1) . ' ' . $this->I['val']['ATagParams'] . $this->I['accessKey']['code'] . '>';
$this->I['A2'] = '</a>';
}
This will always add at least one space, but actually it seems $this->I['val']['ATagParams'] is at the very least of value ' ', possibly to never cause bad attributes.
Updated by Gerrit Code Review about 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25322
Updated by Marc Bastian Heinrichs almost 11 years ago
- Project changed from 2559 to TYPO3 Core
- Category changed from Fluid to Fluid
Updated by Marc Bastian Heinrichs almost 11 years ago
- Category deleted (
Fluid) - Is Regression set to No
- TYPO3 Version set to 6.1
Updated by Tomita Militaru over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 97e50c5e9782bececdbc474af124fb9d65209eef.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed