Bug #96809
closedAfter updating from 11.5.5 to 11.5.6 my image from the page properties is no longer rendered into the TypoScript HMENU
100%
Description
Is this a bug in 11.5.6 or do I need to adjust something in my TypoScript to make it work again with 11.5.6?
Currently I have downgraded back to 11.5.5. There my image is rendered into the menu without any problems.
I hope someone can help.
My FILES not working any more after update to 11.5.6:
temp.header.mainNavigation = HMENU
temp.header.mainNavigation {
special = list
special.value = 25
1 = TMENU
1 {
wrap = <ul><li class="level-up"><span class="standard-button back">zurück</span></li>|</ul>
NO = 1
NO {
wrapItemAndSub = <li class="first navitem-{field:uid}" rel="{field:uid}">|</li> |*| <li class="navitem-{field:uid}" rel="{field:uid}">|</li> |*| <li class="last navitem-{field:uid}" rel="{field:uid}">|</li>
wrapItemAndSub.insertData = 1
ATagBeforeWrap = 1
linkWrap = <span class="square"><span class="square-inner clearfix">|</span></span>
ATagParams = class="hasimage"
ATagParams.override.cObject = COA
ATagParams.override.cObject {
if.isFalse.field = media
10 = TEXT
10.value = class="noimage"
}
stdWrap {
cObject = COA
cObject {
# link text
10 = TEXT
10 {
field = subtitle // nav_title // title
outerWrap = <span class="menu-text second-layer">|</span>
}
# page properties image
20 = FILES
20 {
references {
table = pages
// we are now in context tt_content
uid.data = current:uid // current:uid
// depending whether you use CSC or FSC:
fieldName = media
}
maxItems = 1
renderObj = IMG_RESOURCE
renderObj {
file {
import.data = file:current:uid
treatIdAsReference = 1
width = 150c
height = 150c
}
# stdWrap.wrap = <div class="bg-image" style="background-image:url(|);"></div>
}
}
}
}
}
}
}
page.13 < temp.header.mainNavigation
Updated by Georg Ringer almost 3 years ago
- Status changed from New to Accepted
- Is Regression set to Yes
Updated by Georg Ringer almost 3 years ago
- Related to Bug #96571: StdWrap if.isNull not working anymore in 11.5.5 added
Updated by Georg Ringer almost 3 years ago
problem is in ContentObjectRenderer
line 1358 return $content;
. adding the (string)
will make it work again
Updated by Nikita Hovratov almost 3 years ago
Thanks for reporting! The problematic line in your TypoScript is:
uid.data = current:uid // current:uid
This is wrong usage of current. See: https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/DataTypes/Properties/GetText.html?highlight=current#current
It doesn't use any parameters. I think you meant here tsfe:uid
or field = uid
.
You can even completely remove that line, because the current uid is the default.
Besides that, the FILE content object, should have a better check, whether the uid returned there makes sense.
Updated by Markus Eckert almost 3 years ago
Hi Nikita,
Georg has modified my example code - i think for a better copy&paste debugging.
In my original code, the line looks like this:
uid.data = current:originalUid // current:uid
Is this wrong, too? I think it should be a translation handling fallback. If there is no image in translated page properties, use this from the default language.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73383
Updated by Nikita Hovratov almost 3 years ago
@Markus
As far as I can see in the core code, this can not work. "current" is a simple value, not an array and only used in splitObj and parseFunc.
Where do you have that code from?
"originalUid" is only used for files like: page.10.data = file:current:originalUid
.
Updated by Markus Eckert almost 3 years ago
The base to my code was from here: http://www.pi-phi.de/24.html
-> Bilder in Menüs
Updated by Nikita Hovratov almost 3 years ago
Interesting, I wonder if this has ever worked, or it was always wrong.
As my tests go, the fallback also works without this line.
So my guess is, the line did never work, but didn't cause any trouble up until now.
Updated by Markus Eckert almost 3 years ago
Thanks for your help and commitment!
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73383
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73383
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73383
Updated by Gerrit Code Review almost 3 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73383
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73550
Updated by Nikita Hovratov over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4b2bd72a0e9236a261be5a908bbd3a0e9ae5f93c.