Skip to content

Conversation

@bertoost
Copy link
Contributor

With this change it's possible to have &preHooks on FormItRetriever. This is useful when doing custom loading and keep the nice "redirectToOnNotFound" feature.

For example;
I want to use the submission form for editting again and I link back to the form with some URL parameters (to identify the item to edit). In my custom preHook I can catch that, gather the fields and populate FormIt dictionairy with that. Normally when I go back to the form with a "FormItRetriever" and &redirectToOnNotFound set, the FormIt store file is no longer there or not valid anymore (storeTime expired). With a custom snippet you can set values and this will make the request valid again.

With the if empty around the preHooks call it will make the submission values the most important and overrule the preHook stuff, that's perfect as far I can see.

With this change it's possible to have &preHooks on FormItRetriever. This is useful when doing custom loading and keep the nice "redirectToOnNotFound" feature.

For example;
I want to use the submission form for editting again and I link back to the form with some URL parameters (to identify the item to edit). In my custom preHook I can catch that, gather the fields and populate FormIt dictionairy with that. Normally when I go back to the form with a "FormItRetriever" and &redirectToOnNotFound set, the FormIt store file is no longer there or not valid anymore (storeTime expired). With a custom snippet you can set values and this will make the request valid again. 

With the if empty around the preHooks call it will make the submission values the most important and overrule the preHook stuff, that's perfect as far I can see.
@bertoost
Copy link
Contributor Author

Please also add

&& !$fi->request->hasSubmission()

To the new if() statement

SintezCode pushed a commit to SintezCode/FormIt that referenced this pull request Jul 10, 2019
Add fenom to chunk by pdoTools if available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant