It would be nice to have a pre-saved data summary page (Like a review page in ecommerce system). Similiar to draft functionality. Not showing fields but the submitted data (via e.g. view).
The user could "go back" and change his value(s).
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | entityform-make_review_page-1893332-17.patch | 5.1 KB | tedbow |
Comments
Comment #1
ericc3 commentedI second that, this will be a great feature to have. I currently use a multi-page form, so having a summary page will help the user.
Comment #2
tedbowAgreed this would a good feature. Marking it as a possible feature for 2.x which I am going to start on soon.
See #1896712: [Meta] Features and Changes for Entityform 2.x
Comment #3
adrianmak commentedthis could be a good feature to display a summary of what form data user is selected before confirm to submit.
Comment #4
adrianmak commentedis there any work around solution before 2.x come out ?
I really need this feature
Comment #5
tedbowI think there would be custom programming. Beside that it doesn't seem so.
Comment #6
bjcooper commentedI also need the feature pretty urgently, so I'm willing to (forced to, rather) begin working on a patch for it in the mean time.
I imagine I'll try to replicate what the Node module does it for its node 'Preview' prior to node creation. Anyone got any thoughts or pointers as to how it should be done?
Comment #7
tedbowI am thinking that it should be a checkbox option on the Entityform Type like "Show review before submit". So not all forms would have to have it.
It should not happen on Draft.
Fields should be validated before the Preview(they aren't validated on draft).
There should probably be a new "preview" View Mode which would determine which fields would be shown on the Preview screen.
The entityform should not actually be saved to the database until after the Preview screen is accepted.
There should be a "back" button to change the submission.
It will need to work with multi-page forms that are created with the Field Group module.
Comment #8
tedbow1 major difference I see in how the preview should act for Entityforms as oppose to nodes is Node preview shows on the same page as the add/edit form for nodes. I think it separate "review" screen for entityforms.
Comment #9
tedbow@bjcooper if want to contact me directly about this work, feel free. There is contact form/info on your Drupal.org account profile so I can't contact you.
Comment #10
kasalla commentedWhat about a drupal common confirmation page?
D6 -> http://drupal.org/project/confirm
D7 -> http://drupal.org/node/470834
D7 API -> http://api.drupal.org/api/drupal/modules%21system%21system.module/functi...
That would...
...be easy to implement (Sorry guys, I have no time to give you a patch)
...keep drupal best practise
...make the process reusable
...give us "view mode". $form_state holds the entity object, so "view mode" can be used. (the rendered entity as $question param in confirm_form();)
...give us a chance to perhaps define a new hook to allow other modules (and rules etc) to interact on that process
Comment #11
tedbow@kasalla I don't think that will work b/c it is really not meant to be used by another form, in our case the entityform_edit_form.
This is more to confirm an action you about to take like deleting an entity.
From: http://drupal.org/node/470834
While this a useful explanation for the front end user it is misleading to as to what is happening in the form system in Drupal. When you are on the node edit screen and you click the "delete" button what happens is
I think this will more be like a multi-step form. You can see an example in the Examples module, the form_example submodule multistep example.
Comment #12
kasalla commentedHey, Thanks for the reply.
I had the same thoughts on this. Perhaps doing a multi-step-form is more suitable for that target.
However, I don´t really think that a confirmation page is the wrong way in those situations. The confirm_form just confirms a form, irrespectiv of its purpose. It´s the last step before an action takes place. Is it just about security? I don´t think so. If it´s not meant to be used in things like node-saving (and leaving preview out), there is a failure in concepts.
If we talk about a preview (like in node handling) we have to stay inside our form and a confirmation makes no sense. Right. But if not, a confirmation is fully sufficiant.
I will give it a try and see what happens :-)
In the Meanwhile mark this a "possible quick work-around"
Comment #13
tedbow@kasalla 1 problem I think that you are going to run into is the that confirm_form function use a $path variable to determine where the user is redirected to if they "cancel" the form.
So the problem when using with entityforms is that when the user clicks cancel(we might label it "go back") then they will lose the state of the current submission. With a multi-step form you can retain the $form_state.
Comment #14
kasalla commentedGood point.
The only way would be to store the $form_state in $_SESSION variable, keyed by a individual identifier (e.g. the form id) which is added to the cancel-link.
Comment #15
tedbowThis would add complexity that isn't needed just to use confirm_form for something it really isn't meant to do. Adding info into $_SESSION would be a last resort.
I have been thinking about this and doing it via a multi-step form would not be that difficult. Just haven't had time.
Comment #16
bjcooper commentedThese are great points; thanks @tedbow and @kaslla. I've just had another project come up, so I won't be working on this quite yet. We'll see who gets time first.
Comment #17
tedbowHere is quick first try. It will probably need work but it does work for me. It is against 2.x
Please review.
Comment #18
tedbowChanging to needs review
Comment #19
tedbowI have committed this to 7.x-2.x. Still could use some review
Comment #20
kasalla commentedWie built a rather complex form, so I hope you can use this info anyway.
Versions: D7.21, 7.x-2.x-dev
Other modules used inside the form:
- Entityreference (with views filters)
- Field Collection (and Entityreference inside a collection)
- Date
- Textfield
- Selectlist
- Dependent Fields
We´ve updated from Version 7.x-1.1 (just to see what may happen).
Following Errors/Warnings occure when preview page comes up.
Comment #21
tedbowThanks for report. I haven't seen this
This is were the error is coming from but our implemantion of hook_entity_info provides 'view modes'. So maybe it is coming from another entity providing module that used on the form?
If you want to figure it out you could either set debug or add these lines in(temporarly of course)
Comment #22
kasalla commentedYap, did it.
$entity_type is empty.
dsm($entity_type); returns nothing.
EDIT: $bundle is empty too.
Comment #23
tedbowStrange, to figure out if this related to viewing this screen you could try a couple things:
Comment #24
tedbowChanging fix to clean up 2.x issues
Comment #26
sylwester commentedThat works very well. The problem is when I enable form preview before submission.
custom_submitfunction runs before preview is generated and not after it was confirmed.