FluidTYPO3 / flux

TYPO3 extension Flux: Dynamic Fluid FlexForms
https://fluidtypo3.org
145 stars 214 forks source link

Section in section copy this insection after the section #835

Closed joneppie closed 9 years ago

joneppie commented 9 years ago

If you use a section into a section, like this:

<flux:form.sheet name="commonConfig" label="Settings">
    <flux:form.section name="settings.testsection" label="An option">
        <flux:form.object name="test" label="Testoption">
            <flux:field.input name="text" label="blah" required="TRUE" />
            <flux:field.input name="value" label="blub" />
            <flux:form.section name="testsection" label="An option for an option">
                <flux:form.object name="test" label="In option Testoption">
                    <flux:field.input name="value" label="in option blub" />
                </flux:form.object>
            </flux:form.section>
        </flux:form.object>
    </flux:form.section>
    <flux:field.input name="settings.blah" label="Blah-Text" default="blah" required="TRUE" />
    <flux:field.input name="settings.blub" label="Blub-Text" />
</flux:form.sheet>

you get the innersection a second time below the outersection sectioninsection

cedricziel commented 9 years ago

Sidenote: I would not solve such requirement with nested sections. I would rather create a "normal" core CType element with a tca relation and nestability. That would buy you a much cleaner implementation + the ability to resolve FAL objects on those nested elements.

Flexforms and therefore Sections are basically not a good way to handle what you would call "content". It's acceptable and handy for settings, but should not be abused by storing content in it (like you seem to be doing).

joneppie commented 9 years ago

I need it for a special form with options and there for suboptions. Thats no content and only settings.

avalkiv commented 9 years ago

@cedricziel, will this issue be fixed? Or should I use CType element?

akasico7 commented 9 years ago

I have the same problem. Is there a solution for this?

NamelessCoder commented 9 years ago

Fixed in development branch, will be in next TER version.

DonGissel commented 9 years ago

Unfortunately this is not yet solved. I tested it using TYPO3 7.2 and 7.4 and the latest dev-version of Flux (7.2.1, built Aug. 5th at 16:45 CET), and there are still some nasty issues here:

Clearly, something isn't right here. Sadly my real data element on the livesite is far too large for me to edit the XML manually, so right now I'm stuck.

xf- commented 9 years ago

i reopen this, but i think most issues are fixed or in a specific environment

DonGissel commented 9 years ago

The clock was ticking, so I ended up recreating the flexform as an extbase-model and reentering all the data, which gave me the added benefit of having a much nicer graphical interface. Still, nested sections in flexforms should work – and have done so perfectly until recently.

NamelessCoder commented 9 years ago

I don't know what to say... except I've tested and re-tested and re-re-re-re-re-re-re-tested this and it really is solved. There are no more stray sections (in sections, in sections). I promise.

<flux:form id="example" options="{group: 'FCE'}">
    <!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:flexform tag -->
        <flux:form.section name="test">
             <flux:form.object name="inner" label="Test object">
                   <flux:field.input name="field" label="Test" />
                   <flux:form.section name="test">
                          <flux:form.object name="inner2" label="Another test object">
                                 <flux:field.input name="field2" label="Test 2" />
                          </flux:form.object>
                   </flux:form.section>
            </flux:form.object>
    </flux:form.section>
    <flux:field.input name="blargh" label="Blah" />
</flux:form>

screen shot 2015-08-08 at 04 32 01

Now, the other error that you are facing is not related to this "insection" bug (which is solved). The one you have is caused by HTML field names being identical and causing collisions when you save the record, if you create more than one nested object per save. And this error is not caused by nor fixable in Flux - it is a core bug that would affect any DS; FlexForm, array and Flux alike.

I'm not sure when it began or if any attempts were made to solve it, but the JS that handles this should be replaced by now. I tested this in TYPO3 7.4.0 and to my surprise it still does this.

@DonGissel I'm closing this one since the original issue is fixed. Please report the remaining problem to the TYPO3 issue tracker ;)