Project

General

Profile

Actions

Bug #50566

closed

Menu-links generate two empty spaces before closing angle bracket in source code

Added by Gone With the Wind over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2013-07-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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...


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #60595: Add use-statement for GeneralUtilityClosed2014-07-26

Actions
Actions #1

Updated by Patrick Schriner over 10 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.

Actions #2

Updated by Gerrit Code Review over 10 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

Actions #3

Updated by Marc Bastian Heinrichs about 10 years ago

  • Project changed from 2559 to TYPO3 Core
  • Category changed from Fluid to Fluid
Actions #4

Updated by Marc Bastian Heinrichs about 10 years ago

  • Category deleted (Fluid)
  • Is Regression set to No
  • TYPO3 Version set to 6.1
Actions #5

Updated by Tomita Militaru almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF