Closed (fixed)
Project:
Form Builder
Version:
7.x-1.x-dev
Component:
Form Builder Core
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2015 at 08:15 UTC
Updated:
19 May 2015 at 09:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
torotil commentedComment #2
torotil commentedHere is my first attempt at refactoring. It uses plugins for form-types and properties. There is only one minor API-change needed: hook_form_builder_types_alter() is now called without the defaults inserted. With the refactoring I was already able to remove the 1:1 renderable mapping in form_builder_webform.
The downside is that it still is only a transformation of the original code. The API could still use some cleanup.
I'd like to get some additional eyes on this - or at least let it sit for a while before moving on.
Comment #3
torotil commentedComment #4
torotil commentedComment #5
fenstratGreat work here @torotil. I plan to review this properly in the next few days.
Comment #6
mausolos commentedI was not able to get the patch to work for display classes, which are my primary concern at the moment (ref. from https://www.drupal.org/node/2463259).
I attempted to apply form_builder-oop-combined-2464957-4.patch to my codebase. As a sidenote, it failed both my drush make and my git apply -v (with no error message, in spite of -v), which I thought was a bit strange.
I manually applied the patch changes, line-by-line, so it's possible I might have made a mistake somewhere.
1) I created a new form.
2) I added a fieldset (using form_builder's UI page).
3) I added a class to the fieldset.
4) I saved the webform.
5) Before doing anything else, I checked the fieldset CSS classes field again, and found it to be empty.
6) I loaded the form_builder UI view in a completely different browser (Chrome vs. FF), to be sure form_builder's aggressive cache wasn't doing something funky. It also loaded without the CSS classes that I had entered
7) If I don't save the new blank form_builder UI of my form, but just go to view the form after adding the class, the class still renders as expected.
I hope this was of some use. I look forward to seeing the working solution!
Charles
Comment #7
torotil commentedThe patch was generated using
git diffyou can apply it with patch -p1.Using webform-7.x-4.x and form_builder-7.x-1.x + the patch from number 4 I did the following:
0) apply the patch via
curl https://www.drupal.org/files/issues/form_builder-oop-combined-2464957-4.patch | patch -p11) create a new form
2) add a fieldset to the form and a textfield within it
3) add a class to the fieldset
4) reloaded the fieldset configuration form (clicking twice on the pen) and check whether the class is still set -> class was set
5) save the form, open the fieldset configuration form again and check whether the class is still set -> class was set.
6) view the webform, check whether the class is in the output -> class was in the output.
@mausolos Could you please check whether the patch was applied correctly. This sounds a lot like you're testing the plain 7.x-1.x.
Please keep those reviews coming ;)
Comment #9
torotil commentedI've added additional documentation to the patches and committed them to 7.x-1.x -- It would still be good to have someone else opinion on the changes, though.
I guess the next step is to turn elements/fields into plugins too.