Skip to content

Commit

Permalink
[BUGFIX] Replace undefined variable with reading PageTSConfig option
Browse files Browse the repository at this point in the history
Long story short, through multiple refactorings along the road, from
the inital introduction of the 'mod.newContentElementWizard.override'
option with #70055 over streamlining the TSConfig api (#85016), a lot
of stations in between which already broke reading that option, which
was used for adding the 'new record button', this was refactored into
a dedicated 'createAddButtonForTable()' method with #94456, ending up
with even more broken code and leaving an undefined variable $tsConfig.

Instead of removing the unused variable we load the pageTs here to be
able to read this option again and restore the intended behaviour.

Resolves: #96596
Related: #94456
Related: #85016
Related: #70055
Releases: main, 11.5
Change-Id: I91b24bf338c6531ea220a41dca2076b71a7da96f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73096
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
sbuerk authored and o-ba committed Jan 20, 2022
1 parent a4bf3c3 commit f032df4
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -877,7 +877,7 @@ protected function createNewRecordButton(string $table): string

if ($table === 'tt_content') {
$url = (string)$this->uriBuilder->buildUriFromRoute(
$tsConfig['mod.']['newContentElementWizard.']['override'] ?? 'new_content_element_wizard',
BackendUtility::getPagesTSconfig($this->id)['mod.']['newContentElementWizard.']['override'] ?? 'new_content_element_wizard',
[
'id' => $this->id,
'returnUrl' => $this->listURL(),
Expand Down

0 comments on commit f032df4

Please sign in to comment.