I'm developing a new module - fully API and templated. It's going reasonably well.
For those that haven't taken the plunge yet, the idea seems to be to have a series of stages in creating your functionality. One stage is made up of:
1. A function to prep your form.
2. The form itself.
3. A function to deal with the data and redirect you to the next page.
My module has a number of these strung together and I'm using Mark's recommendation of using session variables to pass key data between the stages. Specifically, a user selects a membership type, then fills in their details, then the data is saved and they are presented with a confirmation screen, before a bit more data is saved, they go through credit card processing, the data is tweaked again and they end up at a final "all done" screen.
The issue I have is with darn users trying to go back to previous pages and/or refreshing the current page. It just seems to muck all my data about and I get various errors such as "you don't have Auth" because the authid used in the previous form is now no good.
Is there a "right and propper" way to go about the coding of this sort of linked stage design? I'm assuming there's either some process I need to go through after/before each stage or some API functions that need calling to ensure data remains consistent throughout.
I'll be away from my puter for a whole week (which I'm strangely looking forward to), but will catch up with the thread when I return. Cheers in advance.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 created topic »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 01:39 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Mod Dev: User form navigation
-
- Rank: Softmore
- Registered: May 25, 2004
- Last visit: Oct 21, 2009
- Posts: 192
-
**unknown user**
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 1097
One of the only way to prevent this (and it's 50% ), is to have the pnVarCleanFromInput in your main form page (function to prep form) that gets the data if one goes back using a form button instead ot the "Previous Page" button of the browser...
You put in hidden values the data a user entered and make a go back button (different form tag). The AuthID is then reset but valid for the next page when the user hit the submit and fields (or part of them) are already set with what the user entered the first time.
That won't prevent the "Previous page" problem... but it will help.
-
- Rank: Softmore
- Registered: May 25, 2004
- Last visit: Oct 21, 2009
- Posts: 192
That's certainly an option, but not a very thorough one as you've pointed out.
Are there no methods, when using pnRender, to make previous pages unavailable? There are some caching functions, but I'm not really clear on what they actually allow you to do, even after reading the Smarty documents.
At the moment, it seems like I'll have to add a huge heap of defensive functionality to my coding to stop people messing up when using a browser's native validation during form data entry. Is there really no cleaner way? -
- Rank: Softmore
- Registered: May 25, 2004
- Last visit: Oct 21, 2009
- Posts: 192
What about some of the caching commands? I suppose I need to test this all out, as nobody seems to know much about usability of module design :( -
- Rank: Softmore
- Registered: May 25, 2004
- Last visit: Oct 21, 2009
- Posts: 192
It wasn't that. It was more a way of it causing chaos. Sometimes when you go back, you get a page expired message for example. That might help. I think I need to play a bit more. Will get back when I find a solution - whole or partial.
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
