-
Notifications
You must be signed in to change notification settings - Fork 4
Cannot edit content in nested sections, only adding works #4
Comments
There is a good chance that this is already fixed with 25e2592. This commit does fix the missing array for containers when saving/creating data structures. |
Hi, I did a quick test and patched the two lines: this doesn't fix the problem, neither did an upgrade to release 7.6.5. |
Just a quick question: What is the new correct XML-Code for containers and snippets? Where must the |
Let me add some historical context to this issue which will then explain, why I don't have a quick answer. First of all, I didn't plan to make the administration module available at all. I wanted a solution for all the people that had existing installations to be able to upgrade to TYPO3 7.6. I realized that a lot of people actually want to use TV even for new projects or at least adjust existing page templates/elements. That's when I tried to structure the code that is responsible for creating data structures. There is a clean seperation of controller and view. During that refactoring I needed to try different structures and realized, that the new form engine didn't behave like before in enough ways so I'd be forced to adjust the structure of the flexforms. What I know for sure is, that if you have regular elements (no container/section), you are not allowed to put more than 1 child element into the During that change I accidently wrote a wrong documentation. Obviously, containers are expected to have the title tag outside the The This explanation does not replace a proper documentation and maybe even an xsd. However, time! What I have planned for this week, is to see what structure an old 4.5 creates, what my current version does, compare these and define rules. I'll shortly tell you why I have that time issue. Two weeks ago I was in hospital for a surgery. The weeks before I spent quite a lot of time in the hospital for diagnosis and my journey continues. I am not about to die but I am required to make my hospital visits a priority. Then, there is the time I need for my job to not run out of money. Then, there is this work on templavoila, which is not financed any more by sponsors. This doesn't mean I will stop the maintenance, actually the opposite is the case, but at the moment I am having a hard time finding a proper time frame to fix these bugs. If you yourself have some spare time and are willing to help, I'd be very happy to any kind of help. I mentioned my plans to create that flexform definition by comparing an old version with a current one. If I had any data regarding that topic, I could more easily focus on the fixes and documentation. btw: you are the only one so far that is using this issue tracker. I setup a Gitlab for the sponsors, which they used for month now. In there, I have a bunch of open issues as well. All the versions from 7.6.1 til now are based on reports from my sponsors which I worked on with a higher priority. All this is not to be meant as an excuse but an explanation for why it's hard to expect quick results. I hope you can understand my struggles a bit and have some patience. :) |
I didn't want to hurry you, time is limited and priorities change. So please understand my input as input. :) And good luck with your medical condition. I am now reading into Flexforms documentation to find out, what's the currently correct definition. Maybe, I can contribute something, but my time slot for that is rather short. Do you have some suggestions, where I should read, there are many documentation places. At the moment, I see many of those exceptions:
Have a nice day and thanks for your explanation. |
This is the part where the flexform is evaluated. From that we can derive the rule that it's only allowed to have a Honestly I am a little bit confused by this myself. ^^ Besides that, I guess you won't find an updated version of the flexform definition in the official docs. At least I didn't find any which drove me mad during the development. |
Alright, I had some time to dig into all this and it doesn't look good. First of all, I created a new data structure in TYPO3 4.5 with an old version of templavoila: flexform.xml
I used that structure and put it into a TYPO3 7.6 with the a templavoila 7.6.5. Now, we have to have a look at two different things:
The Form EngineThe form engine changed a lot regarding the rendering of flexforms. There are some facts that are worth mentioning:
There is the extension styleguide, which is kind of an official documentation about what kind of flexform structures are supported. The TemplaVoila data structure editorThe editor didn't really change compared to the old versions of TemplaVoilà. Pretty much the same rules apply. That's the reason why one can still build nested structures with it, that can also be rendered in the frontend (because TemplaVoilà does the rendering) but cannot be edited in the backend. What's the solution?Well, there is no quick solution at all. I spoke to the core team member that did the implementation of the new form engine. He says, the core dropped nested containers and sections and that there is noone willing to bring that back. Further he said, that it would take a huge amount of time to bring that into the core. One needs to write all the tests and the code needs to be accepted by core devs. Another option is to implement all that in TemplaVoilà. I could do so, but currently I do not have the funds to do so. There is one option I'd like to go with instead: Replace the flexforms with yaml and implement an independent rendering. This would take even more time, but it would be a much cleaner implementation because then TemplaVoilà does not overwrite core classes any more. However, I don't know what to do exactly now. What I know for sure, is that there will not be any quick solution. On top of that, I know that there are more problems ahead in TYPO3 8.7. I'll think about all that and maybe come up with another crowdfunding campaign. |
Thanks for your information. Phew, that is quite frustrating. In my case, most of the FCEs use nested sections and I cannot change that easyly, as there is a huge amount of content relying on that. But then, I wonder why the nestes sections still work well, when they are created, just the editing of exiting content doesn't work anymore. If the nested sections were removed from the core, this should not work at all. Or is this TemplaVoilà handling the form here? |
Do you mean why they can be created in the templavoila module? If so, that's what I tried to explain. That part is pure templavoila code, without any core stuff involved.
That's where the form engine of the core plays its role and conflicts with the created structures. |
The thing is, that I can create new content correctly. All form elements of the nested sections work as expected. When I save the content element, the new inserted content is not visible in the form, but was persisted to the database and is rendered in the frontend and the preview. When I add new content to those nested sections, it is added to the existing content, but also not visible in the form anymore. The effect is, that I can add new content, but cannot edit or delete old content in nested sections. |
I see. I did implement all the changes from compatibility6 into templavoila itself, so your TYPO3 7.6 behaves like a 6.2 version. Things fixes some things but breaks others. I thought that the code, that was taken from compatibility6, would be more stable. Basically, I have a burning house and try to fight the small flames here and there but even if it seems like things are working partly, there is always something wrong. The changes from comaptibility6 bring back multi language flexforms but distort the reality. In fact the structure you are working with doesn't work and with comaptibility6 it just seems to work better. However, the handling is broken and needs to be fixed either way. |
Actual and expected behaviour
I have a quice compex FCE with nested sections. The outer section holds the link categories of a linklist, the inner section the links. The XML created by TemplaVoilà looks like this (I only implemented the needed fields to better reproduce this):
example of nested sections.txt
I only fixed the
<script>
of the link field (as mentioned in #2 ) and the<title>
and<type>
tags of section and containers as described in the breaking changes documentation, so that they are shown in the form. Btw: the xml created by Templavoilà should put the<title>
tags of sections and containers to the correct place outside of the<tx_templavoila>
tag.When I create a new content element with this FCE, I can add link categories and within them also links. When I save this content-element, the data is correctly stored in the database and shown in the rendered frontend-output. So far, all works as expected.
But when I edit this content element again, the links are gone. The categories are still there and I can also add new links, but when I save them, they are added to the still existing but invisible other links and also not shown in the form.
Steps to reproduce the behaviour
The text was updated successfully, but these errors were encountered: