Task #2961
Refactor Controller_Default - Controller_Multistep
| Status: | Closed | Start date: | 2009-03-24 | ||
|---|---|---|---|---|---|
| Priority: | Should have | Due date: | |||
| Assignee: | Reinhard Führicht | % Done: | 60% |
||
| Category: | Code and Architecture | ||||
| Target version: | Stable v1.0 | ||||
| Votes: | 0 |
Description
Reinhard:
I had a look at the code of Controller_Default and Controller_Multistep realizing, that there is too much duplicate code in there. I hadn't had much time to think about it, but I would like to refactor the controllers, so that changes in logic of processing are only in Controller_Default. Controller_Multistep should only extend Controller_Default by overriding and adding methods to do multistep stuff.
Any suggestion are welcome, since this will be a quite difficult task!
Associated revisions
[Bug 2961] Remove the patch already checked in Bug 2936 from branch, r=oliver
History
Updated by Reinhard Führicht about 4 years ago
- Target version set to Stable v1.0
Updated by Reinhard Führicht about 4 years ago
I'm currently working on writing a single Controller handling both single step and multi step forms. I have to test and improve some things, but as far as problems with file uploads and session handling are concerned, the new controller does a much better job right now.
Updated by Fabien Udriot about 4 years ago
Good to hear that! Say when it will be ready for testing.
Updated by Joh. Feustel about 4 years ago
Really looking forward to this Controller and View.
This will probably solve some points from #2929 :-)
Updated by Reinhard Führicht about 4 years ago
If I do my job right, it will solve all points from #2929 :)
Updated by Reinhard Führicht about 4 years ago
- Category set to Code and Architecture
- Assignee set to Reinhard Führicht
- % Done changed from 0 to 30
Updated by Reinhard Führicht about 4 years ago
- % Done changed from 30 to 60
Committed the new Controller 'Controller_Form'!
There are some important changes:
- Single step forms will have to use ###TEMPLATE_FORM1### and ###submit_nextStep### now as they are treated like multistep forms with only one step.
- Removed TS setting 'cleanTempFilesOlderThanHours' and put that code into a preprocessor 'PreProcessor_ClearTempFiles'.
- Removed controller dropdown in Flexform.
- Controller_Default, Controller_Multistep, View_Default and View_Multistep should be useless now and will be deleted when testing is finished.
TODO:
- Testing. Please help guys.
- Currently the Controller_Form is a monster with about 900 lines of code. I don't like this and would like to split some parts into different classes. If you have an idea how to do this, please comment.
I updated the examples and the manual. Please test for yourself and look for bugs. There will be some of them.
Updated by Joh. Feustel about 4 years ago
Tested on multipage form.
I added the search for totalSteps using preg_match_all() on template file to getStepInformation() and the improved step_bar to view_Form. Now all works fine for me.
Please test the search pattern especially with forms using conditions and suffixes.
I'll have a look at #2929 soon since some points still exists.
Updated by Reinhard Führicht almost 4 years ago
What's your opinion about current status of the Controller_Form?
Currently I don't experience any problems with it. Can we close this issue?
Updated by Fabien Udriot almost 4 years ago
The examples from the extension seem to work as well. I didn't notice any things weird.
Updated by Fabien Udriot almost 4 years ago
- Status changed from New to Closed