Project

General

Profile

Actions

Bug #38879

closed

TYPO3 is not defined, if inlineSettings are rendered without ExtJs

Added by Helge Funk over 11 years ago. Updated over 5 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];
             }
         }
Actions #1

Updated by Helge Funk over 11 years ago

  • Assignee deleted (Christian Kuhn)
Actions #2

Updated by Ernesto Baschny over 11 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!

Actions #3

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

Actions #4

Updated by Helge Funk over 11 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.

Actions #5

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/12872

Actions #6

Updated by Gerrit Code Review almost 11 years ago

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

Actions #7

Updated by Gerrit Code Review almost 11 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

Actions #8

Updated by Gerrit Code Review almost 11 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

Actions #9

Updated by Gerrit Code Review almost 11 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

Actions #10

Updated by Benni Mack almost 11 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF