Issue Bug New Orphaned

#91718DatabaseQueryProcessor should find tt_content entries by uid regradless the pid

Aristeidis Karavas 06/26/20, 17:10 updated 03/17/21, 09:30

Description

I created a content element (Footer) which is located on pid 88. I then created a lib to get the content element to all of my pages by addding it on my Layout.

lib.footer = CONTENT
lib.footer.table = tt_content
lib.footer.select.pidInList = 88
lib.footer.select.uidInList=201

When i call it on the page 88 everything works fine. If i call it on another page (55) on the other hand, then the element is found but the information is not there. The variable defined on the DatabaseQueryProcessor comes back empty.
I debuged the query and it seems that TYPO3 request the footer element but on the current pid and not on the pid i defined here:

lib.footer.select.pidInList = 88

The query:

SELECT * FROM `footer` WHERE (`footer`.`pid` IN (55)) AND (2011) AND (`footer`.`sys_language_uid` IN (0, -1)) AND ((`footer`.`deleted` = 0) AND (`footer`.`t3ver_state` <= 0) AND (`footer`.`t3ver_wsid` = 0) AND (`footer`.`t3ver_oid` = 0) AND (`footer`.`starttime` <= 1593183420) AND ((`footer`.`endtime` = 0) OR (`footer`.`endtime` > 1593183420)))

My footer.typoscript

dataProcessing {
   330 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
   330 {
      table = footer
      where.field = uid
      where.dataWrap = |{field:footer_relation}
      as = footerInfo

Now here, if the pid is not defined than it should be ignored and find the tt_content by it’s ID regardless the PID, which it doesn’t do. It always requires a pid and returns an empty footerInfo if called on another page.

If i however add this on my DatabaseQueryProcessor:

pidInList = 88

Then i get the content element’s information on the other pages as well and the query looks like this:

SELECT * FROM `footer` WHERE (`footer`.`pid` IN (88)) AND (2011) AND (`footer`.`sys_language_uid` IN (0, -1)) AND ((`footer`.`deleted` = 0) AND (`footer`.`t3ver_state` <= 0) AND (`footer`.`t3ver_wsid` = 0) AND (`footer`.`t3ver_oid` = 0) AND (`footer`.`starttime` <= 1593183840) AND ((`footer`.`endtime` = 0) OR (`footer`.`endtime` > 1593183840)))

Now i get the content only because i specifically defined the 88 on the DatabaseQueryProcessor

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] DatabaseQueryProcessor should find tt_content entries by uid regradless the pid Resolves: #91718 Releases: main