Bug #27957

TCA tree somehow causes fatal error when using in inline record (IRRE)

Added by Thomas Deinhamer about 4 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2011-07-07
Priority:Must have Due date:
Assigned To:Xavier Perseguers % Done:

100%

Category:FormEngine aka TCEforms Spent time: -
Target version:6.0.0-beta2
TYPO3 Version:4.5 Is Regression:
PHP Version:5.2 Sprint Focus:
Complexity:

Description

Hello folks!

When using the following configuration for
a select field rendered as tree, it's neither
possible to expand inline records, nor to create
new inline records, because the page renderer,
called through the AJAX request, throws an
exception - also mentioned below.

'included_categories' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:hype_store/Resources/Private/Language/locallang_db.xml:tx_hypestore_domain_model_discount.included_categories',
    'config' => array(
        'type' => 'select',
        'foreign_table' => 'tx_hypestore_domain_model_category',
        'MM' => 'tx_hypestore_relation_discount_category',
        'MM_opposite_field' => 'discounts',
        'MM_match_fields' => array(
            'exclude' => 0
        ),
        'minitems' => 0,
        'maxitems' => 999999,

        'renderMode' => 'tree',
        'treeConfig' => array(
            'parentField' => 'parent_category',
            'appearance' => array(
                'expandAll' => TRUE,
                'showHeader' => TRUE
            ),
        ),
    ),
)

The error thrown (ajax response) is...

#1284906026: Language and character encoding are not set.

... which occurs in the file class.t3lib_pagerenderer.php in line 1795.

If I remove the "TCA tree configuration" everything works. The tree also
works, if the record is opened directly. If opened as inline record,
the described behaviour occurs.

T3X_inline500error.t3x - Demo extension for TCA tree error 500 (12.9 kB) Alexander Jahn, 2011-10-04 12:02


Related issues

related to Core - Bug #35244: TCAtree inline record triggers Closed 2012-03-26
duplicated by Core - Bug #31640: TCA: IRRE Inline records + renderMode "tree" -> "Error 50... Resolved 2011-11-07

Associated revisions

Revision d87e3b81
Added by Laurent Cherpit almost 3 years ago

[BUGFIX] Set charset property after cloning t3lib_PageRenderer

TCA tree causes fatal error when using in (IRRE)
1284906026: Language and character encoding are not set.

Change-Id: I6e859cb31edd4280d39e0f1ff268b865ac233fca
Fixes: #27957
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/9874
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

Revision ffd77941
Added by Laurent Cherpit almost 3 years ago

[BUGFIX] Set charset property after cloning t3lib_PageRenderer

TCA tree causes fatal error when using in (IRRE)
1284906026: Language and character encoding are not set.

Change-Id: I6e859cb31edd4280d39e0f1ff268b865ac233fca
Fixes: #27957
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14245
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

Revision d683be0a
Added by Laurent Cherpit almost 3 years ago

[BUGFIX] Set charset property after cloning t3lib_PageRenderer

TCA tree causes fatal error when using in (IRRE)
1284906026: Language and character encoding are not set.

Change-Id: I6e859cb31edd4280d39e0f1ff268b865ac233fca
Fixes: #27957
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14246
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

Revision 88c6a72d
Added by Laurent Cherpit almost 3 years ago

[BUGFIX] Set charset property after cloning t3lib_PageRenderer

TCA tree causes fatal error when using in (IRRE)
1284906026: Language and character encoding are not set.

Change-Id: I6e859cb31edd4280d39e0f1ff268b865ac233fca
Fixes: #27957
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14247
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

History

#1 Updated by Thomas Deinhamer about 4 years ago

Sorry, the code part seems to be corrupted, hope you get the point anyway.

#2 Updated by Steffen Ritter about 4 years ago

  • Category changed from IRRE to FormEngine aka TCEforms
  • Status changed from New to Accepted
  • Assigned To set to Steffen Ritter

#3 Updated by Oliver Hader almost 4 years ago

  • Target version changed from 4.5.4 to 4.5.6

#4 Updated by Andreas Wolf almost 4 years ago

  • Status changed from Accepted to Needs Feedback
  • Target version changed from 4.5.6 to 4.5.7

I could not reproduce this - maybe I'm missing some knowledge about the different IRRE ways here... could you provide a demo extension with a minimum required TCA to reproduce this?

#5 Updated by Alexander Jahn almost 4 years ago

It seems i've ran into the same issue today.
I threw together a simple demo extension as a demonstration. I guess my problem has the same cause as Thomas'.

Install the extension regularily and create a new tt_content record in some page.
Open record, then in tab 'ERROR 500 DEMO' create a new inline record
=> throws error 500, systemLog reports exception #1284906026

In tca.php disable rendering of tca tree in line 28 and creating / expanding of records works

In ext_tables.php line 19 set collapseAll to 0 and existing records show up fine when tca tree is used.

#6 Updated by Chris topher almost 4 years ago

  • Target version changed from 4.5.7 to 4.5.8

#7 Updated by Georg Ringer over 3 years ago

just experienced that too with 4-5-8 ... this didn't occur in older versions of 4-5

#8 Updated by Ernesto Baschny over 3 years ago

  • Target version changed from 4.5.8 to 4.5.12

#9 Updated by Gerrit Code Review over 3 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/9874

#10 Updated by Laurent Cherpit over 3 years ago

Same problem with version 4.6 branch.

The charset property is not defined when the page renderer is cloned.

workaround would to set the charset:

    /**
     * Gets the JavaScript of the pageRenderer.
     * This can be used to extract newly added files which have been added
     * during an AJAX request. Due to the spread possibilities of the pageRenderer
     * to add JavaScript rendering and extracting seems to be the easiest way.
     *
     * @return string
     */
    protected function getJavaScriptAndStyleSheetsOfPageRenderer() {
        /** @var $pageRenderer t3lib_PageRenderer */
        $pageRenderer = clone $GLOBALS['SOBE']->doc->getPageRenderer();

        $pageRenderer->setCharSet($GLOBALS['LANG']->charSet);
        $pageRenderer->setTemplateFile(TYPO3_mainDir . 'templates/helper_javascript_css.html');
        $javaScriptAndStyleSheets = $pageRenderer->render();

        return $javaScriptAndStyleSheets;
    }

#11 Updated by Gerrit Code Review over 3 years ago

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

#12 Updated by Gerrit Code Review over 3 years ago

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

#13 Updated by Gerrit Code Review over 3 years ago

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

#14 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14245

#15 Updated by Gerrit Code Review almost 3 years ago

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

#16 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/14246

#17 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/14247

#18 Updated by Xavier Perseguers almost 3 years ago

  • Status changed from Under Review to Resolved
  • Assigned To changed from Steffen Ritter to Xavier Perseguers
  • Target version changed from 4.5.12 to 6.0.0-beta2
  • % Done changed from 0 to 100

Also available in: Atom PDF