Project

General

Profile

Actions

Bug #28857

closed

BackendConfigurationManager wrong implementation of getCurrentPageId

Added by Georg Ringer over 12 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2011-08-09
Due date:
% Done:

0%

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

Description

the current implementation is wrong

// get current site root
$rootPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1');
if (count($rootPages) > 0) {
    return $rootPages[0]['uid'];
}

    // get root template
$rootTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1');
if (count($rootTemplates) > 0) {
    return $rootTemplates[0]['pid'];
}

it just takes the 1st page with is_siteroot or with a template (with root=1).

this won't work when having more than one tree which is quite common when using TYPO3

Actions #1

Updated by Michael McManus over 12 years ago

  • Category set to Extbase: Configuration
Actions #2

Updated by Gerrit Code Review over 12 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #3

Updated by Gerrit Code Review over 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #4

Updated by Gerrit Code Review over 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #5

Updated by Gerrit Code Review over 12 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #6

Updated by Gerrit Code Review over 12 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #7

Updated by Claus Due about 12 years ago

Note: this is only a problem if the current PID cannot be detected, which usually happens when editing or rendering a cObj of some kind (for BE modules, extension devs will have to take care to pass GET['id'] to each BE view that uses TS, if the dev wants to support sites which use multiple root TS templates).

The coming patch solves the issue by taking the cObj's PID if a cObj is available and no ID was defined in GET.

Actions #8

Updated by Gerrit Code Review about 12 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #10

Updated by Gerrit Code Review over 11 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7154

Actions #11

Updated by Alexander Schnitzler over 11 years ago

  • Target version set to Extbase 6.1
Actions #12

Updated by Alexander Schnitzler about 11 years ago

  • Target version changed from Extbase 6.1 to Extbase 6.2
Actions #13

Updated by Anja Leichsenring almost 11 years ago

  • Target version changed from Extbase 6.2 to Extbase 6.3
Actions #14

Updated by Anja Leichsenring almost 11 years ago

  • Target version changed from Extbase 6.3 to Extbase 6.2
Actions #15

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21185

Actions #16

Updated by Gerrit Code Review almost 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21185

Actions #17

Updated by Alexander Schnitzler almost 11 years ago

  • Status changed from Under Review to Needs Feedback

Patch has been abandonded, so we have to think about this one again.

Actions #18

Updated by Alexander Opitz over 9 years ago

  • Project changed from 534 to TYPO3 Core
  • Category changed from Extbase: Configuration to Extbase
  • Status changed from Needs Feedback to New
  • Target version changed from Extbase 6.2 to 7.0
  • TYPO3 Version set to 4.5
  • Is Regression set to No
Actions #19

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #20

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #21

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #22

Updated by Benni Mack over 8 years ago

  • Target version deleted (7.5)
Actions #23

Updated by Bernhard Kraft almost 8 years ago

  • TYPO3 Version changed from 4.5 to 8

Wouldn't it be a start to allow setting the PID to use (currentPageId) from within TS-Config.

I encountered this issue for an extbase backend action which gets rendered in a TCEform (FormEngine). There is no "&id" parameter but only the ID of the content-element/record to get edited gets passed along. But all those records are stored on a sys folder so in my case a static TS-Config setting would suffice.

Or at least provide a hook/signal at the given code location (getCurrentPageId) so one can put custom code into place.
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php#l132

Actions #24

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Closed

duplicate of #88572

Actions

Also available in: Atom PDF