Bug #64930
closedInfinite javascript loop when trying to add new IRRE element with RTE fields
100%
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
Updated by Frans Saris almost 10 years ago
- Sprint Focus set to Stabilization Sprint
Updated by Stanislas Rolland almost 10 years ago
Please test this change: https://review.typo3.org/#/c/34706/
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.
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
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
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', ), ), ), );
Updated by Stanislas Rolland almost 10 years ago
Do you get the problem when the fields are not RTE-enabled in TCA?
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
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
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
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.
Updated by Nicole Cordes almost 10 years ago
- Status changed from In Progress to Under Review
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
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
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
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
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
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
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
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
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
Updated by Stanislas Rolland almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 67a67d3e6cf34ee84ac6c436b48f15d4836aa38a.