Project

General

Profile

Actions

Bug #64930

closed

Infinite javascript loop when trying to add new IRRE element with RTE fields

Added by Frans Saris almost 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Backend User Interface
Target version:
-
Start date:
2015-02-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

Description

If you try to create a new child element with an RTE element the javascript get into a infinite loop in TYPO3/CMS/Rtehtmlarea/HTMLArea/Util/String

    String.prototype.ellipsis = function(length) {
        var temp = this;
        var trimmed = this;
        if (temp.visualLength() > length) {
            trimmed += "...";
            while (trimmed.visualLength() > length) {
                temp = temp.substring(0, temp.length-1);
                    trimmed = temp + "...";
            }
        }
        return trimmed;
    };

Also opening existing children give issues

TYPO3.settings.Textarea.autosize undefined


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62440: RTE is not loaded when creating new child or when all children are collapsedClosedStanislas Rolland2014-10-24

Actions
Actions #1

Updated by Frans Saris almost 10 years ago

  • Sprint Focus set to Stabilization Sprint
Actions #2

Updated by Stanislas Rolland almost 10 years ago

Please test this change: https://review.typo3.org/#/c/34706/

Actions #3

Updated by Frans Saris almost 10 years ago

Still got a infinite loop at http://master.typo3.local/typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Util/String.js?1421954776:57 when creating/adding a new record. At least that is the message from FireFox.

Opening a existing IRRE element works with the patch.

Actions #4

Updated by Frans Saris almost 10 years ago

Did some extra test but the patch doesn't resolve any of the mentioned bugs. If there are visible RTE fields is works also without the patch for existing IRRE elements.
If displayCond prevents the RTE from being shown you get the following error (also only for existing IRRE records):

TypeError: TYPO3.settings.Textarea is undefined
http://master.typo3.local/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js
Line 635
Actions #5

Updated by Nicole Cordes almost 10 years ago

  • Status changed from New to Needs Feedback

Can't verify this neither with Firefox nor with Chrome. Any special settings in TCA needed? I have a parent element with children by using foreign_selector

Actions #6

Updated by Frans Saris almost 10 years ago

  • Status changed from Needs Feedback to New

Here the TCA that gives troubles

<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

return array(
    'ctrl' => array(
        'requestUpdate' => 'all_day,allow_subscribing',
        'title' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event',
        'label' => 'title',
        'tstamp' => 'tstamp',
        'crdate' => 'crdate',
        'dividers2tabs' => TRUE,
        'versioningWS' => 2,
        'versioning_followPages' => TRUE,
        'origUid' => 't3_origuid',
        'languageField' => 'sys_language_uid',
        'transOrigPointerField' => 'l10n_parent',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'delete' => 'deleted',
        'enablecolumns' => array(
            'disabled' => 'hidden',
            'starttime' => 'starttime',
            'endtime' => 'endtime',
            'fe_group' => 'fe_group',
        ),
        'searchFields' => 'title, teaser, description,',
        'requestUpdate' => 'parent_event',
        'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('eventsmanager') . 'Resources/Public/Icons/tx_eventsmanager_domain_model_event.gif'
    ),
    'interface' => array(
        'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, teaser, description, images, fe_group, categories, linked_events',
    ),
    'types' => array(
        '1' => array('showitem' => '
                    --div--;LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tabs.general,
                    --palette--;LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:palette.event;title,
                    teaser;;;richtext:rte_transform[flag=rte_enabled|mode=ts],
                    description;;;richtext:rte_transform[flag=rte_enabled|mode=ts],
                    images,
                    linked_events,
                    categories,
                    fe_group'),
    ),
    'palettes' => array(
        'title' => array('showitem' => 'title, hidden, --linebreak--, parent_event', 'canNotCollapse' => 1),
    ),
    'columns' => array(
        'sys_language_uid' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
            'config' => array(
                'type' => 'select',
                'foreign_table' => 'sys_language',
                'foreign_table_where' => 'ORDER BY sys_language.title',
                'items' => array(
                    array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
                    array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
                ),
            ),
        ),
        'l10n_parent' => array(
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'exclude' => 1,
            'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
            'config' => array(
                'type' => 'select',
                'items' => array(
                    array('', 0),
                ),
                'foreign_table' => 'tx_eventsmanager_domain_model_event',
                'foreign_table_where' => 'AND tx_eventsmanager_domain_model_event.pid=###CURRENT_PID### AND tx_eventsmanager_domain_model_event.sys_language_uid IN (-1,0)',
            ),
        ),
        'l10n_diffsource' => array(
            'config' => array(
                'type' => 'passthrough',
            ),
        ),
        't3ver_label' => array(
            'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel',
            'config' => array(
                'type' => 'input',
                'size' => 30,
                'max' => 255,
            )
        ),
        'hidden' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:field.hidden',
            'config' => array(
                'type' => 'check',
            ),
        ),
        'starttime' => array(
            'exclude' => 1,
            'l10n_mode' => 'mergeIfNotBlank',
            'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
            'config' => array(
                'type' => 'input',
                'size' => 13,
                'max' => 20,
                'eval' => 'datetime',
                'checkbox' => 0,
                'default' => 0
            ),
        ),
        'endtime' => array(
            'exclude' => 1,
            'l10n_mode' => 'mergeIfNotBlank',
            'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
            'config' => array(
                'type' => 'input',
                'size' => 13,
                'max' => 20,
                'eval' => 'datetime',
                'checkbox' => 0,
                'default' => 0
            ),
        ),
        'title' => array(
            'exclude' => 0,
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.title',
            'config' => array(
                'type' => 'input',
                'size' => 30,
                'eval' => 'trim,required'
            ),
        ),

        'parent_event' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.parent_event',
            'config' => array(
                'type' => 'group',
                'internal_type' => 'db',
                'allowed' => 'tx_eventsmanager_domain_model_event',
                'minitems' => 0,
                'maxitems' => 1,
                'size' => 1,
                'wizards' => array(
                    'suggest' => array(
                        'type' => 'suggest',
                    ),
                ),
            ),
        ),
        'teaser' => array(
            'exclude' => 1,
            'displayCond' => 'FIELD:parent_event:<:1',
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.teaser',
            'config' => array(
                'type' => 'text',
                'cols' => 40,
                'rows' => 5,
                'eval' => 'trim'
            ),
        ),
        'description' => array(
            'exclude' => 1,
            'displayCond' => 'FIELD:parent_event:<:1',
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.description',
            'config' => array(
                'type' => 'text',
                'cols' => 40,
                'rows' => 15,
                'eval' => 'trim'
            ),
        ),
        'images' => array(
            'exclude' => 1,
            'displayCond' => 'FIELD:parent_event:<:1',
            'l10n_mode' => 'mergeIfNotBlank',
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.images',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                'images',
                array(
                    'appearance' => array(
                        'createNewRelationLinkTitle' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.images.add'
                    ),
                ),
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
            )
        ),
        'categories' => array(
            'exclude' => 1,
            'l10n_mode' => 'exclude',
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xlf:tx_eventsmanager_domain_model_event.categories',
            'config' => array(
                'type' => 'select',
                'foreign_table' => 'sys_category',
                'foreign_table_where' => ' AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC',
                'MM' => 'sys_category_record_mm',
                'MM_opposite_field' => 'items',
                'MM_match_fields' => array(
                    'tablenames' => 'tx_eventsmanager_domain_model_event',
                    'fieldname' => 'categories',
                ),
                'renderMode' => 'tree',
                'treeConfig' => array(
                    'parentField' => 'parent',
                    'appearance' => array(
                        'expandAll' => FALSE,
                        'showHeader' => TRUE,
                        'maxLevels' => 99,
                        'width' => 600,
                    ),
                ),
                'size' => 10,
                'autoSizeMax' => 20,
                'minitems' => 0,
                'maxitems' => 999,
            ),
        ),
        'linked_events' => array(
            'exclude' => 1,
            'displayCond' => 'FIELD:parent_event:<:1',
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.linked_events',
            'config' => array(
                'type' => 'inline',
                'foreign_table' => 'tx_eventsmanager_domain_model_event',
                'foreign_field' => 'parent_event',
                'maxitems' => 9999,
                'appearance' => array(
                    'newRecordLinkAddTitle' => TRUE,
                    'levelLinksPosition' => 'both',
                    'useSortable' => 0,
                    'collapseAll' => 1,
                    'expandSingle' => 0,
                    'enabledControls' => array(
                        'info' => 0,
                        'new' => 0,
                        'dragdrop' => 0,
                        'sort' => 0,
                        'hide' => 1,
                        'delete' => 1,
                        'localize' => 0
                    )
                )
            ),
        ),
        'fe_group' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:eventsmanager/Resources/Private/Language/locallang_db.xml:tx_eventsmanager_domain_model_event.fe_group',
            'config' => array(
                'type' => 'select',
                'size' => 5,
                'maxitems' => 20,
                'items' => array(
                    array(
                        'LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login',
                        -1,
                    ),
                    array(
                        'LLL:EXT:lang/locallang_general.xml:LGL.any_login',
                        -2,
                    ),
                    array(
                        'LLL:EXT:lang/locallang_general.xml:LGL.usergroups',
                        '--div--',
                    ),
                ),
                'exclusiveKeys' => '-1,-2',
                'foreign_table' => 'fe_groups',
                'foreign_table_where' => 'ORDER BY fe_groups.title',
            ),
        ),
    ),
);
Actions #7

Updated by Stanislas Rolland almost 10 years ago

Do you get the problem when the fields are not RTE-enabled in TCA?

Actions #8

Updated by Frans Saris almost 10 years ago

With RTE disabled for those fields adding a new child element works, but opening an existing one still give the error

Uncaught TypeError: Cannot read property 'autosize' of undefined

Actions #9

Updated by Nicole Cordes almost 10 years ago

  • Status changed from New to In Progress
  • Assignee set to Nicole Cordes

Thanks for the TCA - have the same trouble now

Actions #10

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #11

Updated by Nicole Cordes almost 10 years ago

  • Status changed from Under Review to In Progress

The "real" problem here is the option 'collapseAll' => 1 for the inline parent field which triggers the loop.

Actions #12

Updated by Nicole Cordes almost 10 years ago

  • Status changed from In Progress to Under Review
Actions #13

Updated by Gerrit Code Review almost 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #14

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #15

Updated by Gerrit Code Review almost 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #16

Updated by Gerrit Code Review almost 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #17

Updated by Gerrit Code Review almost 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #18

Updated by Gerrit Code Review almost 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #19

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #20

Updated by Gerrit Code Review almost 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #21

Updated by Gerrit Code Review almost 10 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36860

Actions #22

Updated by Stanislas Rolland almost 10 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF