Project

General

Profile

Actions

Bug #17119

closed

RTE in child elements overwrites field in parent element

Added by Gregor over 17 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
-
Start date:
2007-05-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I both parent elemt and child element of an IRRE object contain an RTE field, the content of the child RTE field overwrites the parent RTE on saving.

Scenario:

I created a parent table called "...downloads" and a child table called "...credits". The credit info is set up as a child element of downloads. Both contain a RTE element.

If I create a new downloads item, fill out all fields including the RTE field "description", create a new child element "credits" and fill out its RTE field "credits", too, the RTE content of the parent element is replaced by the content of the "credits" child element after saving. Meaning, both RTE elements now contain the same data. The same happens, if I do save the parent element before creating a "credits" child element. All other fields remain unchanged.

If I edit the RTE field of the parent element afterwards and replace the credits content by the original content for the parent element, everything is saved as intended. No overwriting of foreign fields or something like this. Same happens, if you do create a child element somewhat later by editing the parent object.

Typo3 4.1.1
Linux server
There are no error messages or something like this.
TCA attached
I can provide the whole extension, if requested.
(issue imported from #M5556)


Files

tca.php (11.9 KB) tca.php Administrator Admin, 2007-05-03 14:09
0005556_v3.patch (3.12 KB) 0005556_v3.patch Administrator Admin, 2007-05-04 07:57
0005556_v5.patch (7.99 KB) 0005556_v5.patch Administrator Admin, 2007-07-13 14:26
0005556_v5_since_411.patch (228 KB) 0005556_v5_since_411.patch Administrator Admin, 2007-07-13 14:31
0005556_v6.patch (6.14 KB) 0005556_v6.patch Administrator Admin, 2007-07-16 09:02

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #17247: Load Inline Elements On DemandClosedSusanne Moog2007-04-26

Actions
Related to TYPO3 Core - Bug #17484: RTEhtmlarea is not show in child records if parent has no RTEClosedOliver Hader2007-07-18

Actions
Has duplicate TYPO3 Core - Bug #17431: tt_products 2.6.0 conflicts with htmlarea 1.5.2 and Typo3 4.1.1ClosedOliver Hader2007-06-30

Actions
Actions #1

Updated by Oliver Hader over 17 years ago

I can confirm this issue.

The problem is located in the RTEcounter variable in TCEforms. It will be incremented each time a RTE is rendered. When a new child record is rendered using AJAX this process doesn't know how many RTE instances have been created before.

Thus each new dynamically created child has the RTEcounter set to "1" - and so the first RTE instance gets overwritten.

Actions #2

Updated by Oliver Hader over 17 years ago

The attached patch should solve the problem.
On creating new child records now the number of RTE instances is sent with the AJAX call and the RTEcounter variable in TCEforms gets adjusted.
Please test the patch and give me some feedback.

Actions #3

Updated by Gregor over 17 years ago

works perfect for me.

Now, child records save without overwriting the parent object's RTE field.

I did test several combinations of "new parent and creating child records without saving first", "creating parent record, saving, creating child records", "creating parent record, saving, closing, editing, creating child records" etc. All combinations I tried did save without any failures.

Actions #4

Updated by Oliver Hader over 17 years ago

On clicking the "create new record" link more than once - what is okay
in general - TCEforms gets the same value for the $RTEcounter variable.
Thus, it will again overwrite another RTEhtmlarea instance... (argh)

A solution could be to process and index the newly RTE after it has been
fetched from server via AJAX. Currently the index is set by
PHP/TCEforms, in future I could imagine that JavaScript is doing this
dynamically (only in IRRE context, not for regular standard
tt_content!). But to do this there are some changes necessary in
RTEhtmlarea which would be covered by the term "bugfix" and thus could
only be fixed in Trunk.

Actions #5

Updated by Oliver Hader over 17 years ago

I decided to drop the possibility to create more child records during AJAX requests are processed. The createNewRecord function will be locked when fired and gets released when the AJAX request finished (or failed because of a unreachable server).

This behaviour might change again in TYPO3 4.2.0, but for the 4.1 branch its necessary to have get RTE working in IRRE.

The attached patch 0005556_v5.patch is against the current TYPO3_4-1 branch (revision 2402). If you use the release package of TYPO3 4.1.1 and like to test the changes, please use the patch in "0005556_v5_since_411.patch" which envolves bug #17101, #17101 and this one.

Actions #6

Updated by Oliver Hader over 17 years ago

Committed to SVN:
  • TYPO3_4-1 (rev. 2422)
  • Trunk (rev. 2423)
Actions

Also available in: Atom PDF