Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove pidList from getSingleRecords() #25

Closed
SvenJuergens opened this issue Nov 25, 2016 · 3 comments
Closed

remove pidList from getSingleRecords() #25

SvenJuergens opened this issue Nov 25, 2016 · 3 comments
Labels

Comments

@SvenJuergens
Copy link

hi,

maybe it's more a question as an issue.
This is the DB Query for singleRecords

            $addresses = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                '*',
                'tt_address',
                'uid IN(' . $uidList . ') ' . (!empty($this->conf['pidList']) ? ' AND pid IN (' . $this->conf['pidList'] . ')' : '')
                . $this->cObj->enableFields('tt_address')
            );

why you ask for pidList, uid should be enough as unique identifier. or not?
Problem is, if you don't set a pidList in TS or Flexform the pidList is set to $GLOBALS['TSFE']->id in init()

  $pages = $pages ?
            implode(GeneralUtility::intExplode(',', $pages), ',') :
            $GLOBALS['TSFE']->id;

so in the DB Query there is always a pidList and you must set the correct pidList if you only want to use singleRecords, it's very confusing for an integrator.

best regards
Sven

@BastianBalthasarBux
Copy link
Contributor

Hi @SvenJuergens,
Thanks for reporting, I will have a look at it!

@bmack
Copy link
Member

bmack commented Jun 16, 2017

This is a principle which is around 15ys old and can be found in a lot of other TypoScript-related logic - still in the core.

The PID is a constraint, especially useful in multisite systems or with large access rights permissions so editors cannot select an address from a different page they do not have access to (esp if you have addresses in different locations). Basically, editors can only add a plugin to a storage folder and to an address they have access to.

@BastianBalthasarBux
Copy link
Contributor

Pretty much what I think too, @bmack
So i will close this issue, as it won't be "solved" for pi-base plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants