Bug #38879

TYPO3 is not defined, if inlineSettings are rendered without ExtJs

Added by Helge Funk over 9 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-07-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The JavaScript object "TYPO3" is not defined, if inlineSettings (TYPO3.settings / TYPO3.lang) are rendered without ExtJ.

Reproduce: Add inline settings in pagerenderer without adding ExtJs...

Affects 4.5, 4.6, 4.7, 6.0

Index: t3lib/class.t3lib_pagerenderer.php
===================================================================
--- t3lib/class.t3lib_pagerenderer.php    (revision 501)
+++ t3lib/class.t3lib_pagerenderer.php    (working copy)
@@ -1889,6 +1889,7 @@
             }
         } else {
             if ($inlineSettings) {
+                $inlineSettings = 'if (typeof TYPO3 === "undefined") TYPO3 = {};' . CRLF . $inlineSettings;
                 $out .= $this->inlineJavascriptWrap[0] . $inlineSettings . $this->inlineJavascriptWrap[1];
             }
         }
#1

Updated by Helge Funk over 9 years ago

  • Assignee deleted (Christian Kuhn)
#2

Updated by Ernesto Baschny over 9 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (4.5.18)
  • TYPO3 Version changed from 4.7 to 4.5

Thanks for reporting. Do you have some code snippet (extension?) where this problem can be reproduced easily? Thanks!

#3

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Needs Feedback to Under Review

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

#4

Updated by Helge Funk over 9 years ago

/** @var $pageRenderer t3lib_PageRenderer */
$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();

$settings = array('foo' => 'bar');
$pageRenderer->addInlineSettingArray('FooBar', $settings);

Add this code in a cached plugin... for example a simple extbase extension.

#5

Updated by Gerrit Code Review over 8 years ago

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

#6

Updated by Gerrit Code Review over 8 years ago

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

#7

Updated by Gerrit Code Review over 8 years ago

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

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/20393

#9

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/20392

#10

Updated by Benni Mack over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#11

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF