Section-based FCEs are saved with incorrect element ID
When working with trunk and FCEs that have sections defined, saving the FCE results in bad data in the the FCE XML. Instead of an element like
I end up with
This data results in PHP errors in both the frontend and in the TV Page Module.
From what I can tell, these IDs are related to the FCE changes in changeset 1628. In TCEMain, the temporary IDs are mapped into normal section indexes, and the normal section elements are saved FCE XML. In the current code, this mapping only occurs if the element is not new. When I move the mapping outside this check so that it always occurs, saving and rendering work fine for me.
I'm attaching the patch for this issue. I don't fully understand all the code at this point in TYPO3 so there may be better ways to get it done, but it does seem to work for me.
(issue imported from #M7067)