Bug #28857

BackendConfigurationManager wrong implementation of getCurrentPageId

Added by Georg Ringer almost 10 years ago. Updated about 1 year 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

#1

Updated by Michael McManus over 9 years ago

  • Category set to Extbase: Configuration
#2

Updated by Gerrit Code Review over 9 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

#3

Updated by Gerrit Code Review over 9 years ago

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

#4

Updated by Gerrit Code Review over 9 years ago

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

#5

Updated by Gerrit Code Review over 9 years ago

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

#6

Updated by Gerrit Code Review over 9 years ago

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

#7

Updated by Claus Due about 9 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.

#8

Updated by Gerrit Code Review about 9 years ago

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

#9

Updated by Markus Günther almost 9 years ago

  • Has patch changed from No to Yes
#10

Updated by Gerrit Code Review over 8 years ago

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

#11

Updated by Alexander Schnitzler over 8 years ago

  • Target version set to Extbase 6.1
#12

Updated by Alexander Schnitzler about 8 years ago

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

Updated by Anja Leichsenring almost 8 years ago

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

Updated by Anja Leichsenring almost 8 years ago

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

Updated by Gerrit Code Review almost 8 years ago

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

#16

Updated by Gerrit Code Review almost 8 years ago

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

#17

Updated by Alexander Schnitzler almost 8 years ago

  • Status changed from Under Review to Needs Feedback
  • Has patch changed from Yes to No

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

#18

Updated by Alexander Opitz over 6 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
#19

Updated by Mathias Schreiber over 6 years ago

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

Updated by Benni Mack almost 6 years ago

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

Updated by Susanne Moog almost 6 years ago

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

Updated by Benni Mack over 5 years ago

  • Target version deleted (7.5)
#23

Updated by Bernhard Kraft about 5 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

#24

Updated by Georg Ringer about 1 year ago

  • Status changed from New to Closed

duplicate of #88572

Also available in: Atom PDF