Project

General

Profile

Actions

Bug #96809

closed

After updating from 11.5.5 to 11.5.6 my image from the page properties is no longer rendered into the TypoScript HMENU

Added by Markus Eckert almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
Start date:
2022-02-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
TypoScript HMENU
Complexity:
Is Regression:
Yes
Sprint Focus:

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

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #96571: StdWrap if.isNull not working anymore in 11.5.5Closed2022-01-18

Actions
Actions #1

Updated by Georg Ringer almost 3 years ago

  • Status changed from New to Accepted
  • Is Regression set to Yes
Actions #2

Updated by Georg Ringer almost 3 years ago

  • Related to Bug #96571: StdWrap if.isNull not working anymore in 11.5.5 added
Actions #3

Updated by Georg Ringer almost 3 years ago

problem is in ContentObjectRenderer line 1358 return $content;. adding the (string) will make it work again

Actions #4

Updated by Georg Ringer almost 3 years ago

  • Description updated (diff)
Actions #5

Updated by Markus Eckert almost 3 years ago

  • Description updated (diff)
Actions #6

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.

Actions #7

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.

Actions #8

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

Actions #9

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.

Actions #10

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

Actions #11

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.

Actions #12

Updated by Markus Eckert almost 3 years ago

Thanks for your help and commitment!

Actions #13

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

Actions #14

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

Actions #15

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

Actions #16

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

Actions #17

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

Actions #18

Updated by Nikita Hovratov over 2 years ago

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

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF