Bug #91718

DatabaseQueryProcessor should find tt_content entries by uid regradless the pid

Added by Karavas Aristeidis over 1 year ago. Updated 9 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-06-26
Due date:
% Done:

0%

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

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


Related issues

Related to TYPO3 Core - Feature #93450: ContentObjectRenderer: allow TypoScript select object without any constraint of uidInList or pidInListUnder Review2021-02-05

Actions
#1

Updated by Karavas Aristeidis over 1 year ago

  • Subject changed from lib.something doesn't take the pidInList in consideration to DatabaseQueryProcessor should find tt_content entries by uid regradless the pid
#2

Updated by Jan Kornblum over 1 year ago

I had a similar issue recently, to get elements by their uid independent from pid. My workaround was to set pidInList=1 and recursive=99 to get them regardless of the pid.

#3

Updated by Joerg Kummer 10 months ago

  • Related to Feature #93450: ContentObjectRenderer: allow TypoScript select object without any constraint of uidInList or pidInList added
#4

Updated by Ayke Halder 10 months ago

It should already be possible to select records without pid constraint by setting:

select.pidInList = 0

See TypoScript > Functions > select > pidInList

#5

Updated by Stefan P 9 months ago

Ayke Halder wrote in #note-4:

It should already be possible to select records without pid constraint by setting:

[...]

See TypoScript > Functions > select > pidInList

Yes, but this should happen implicitly as soon uidInList is used. That's what this issue is about, as far as I understand it.

Also available in: Atom PDF