6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
10/17/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#4083] preserveVarByPost, hidden value: output not within form tags
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. .. ..__ . , | ||__||\/|[__) \./ |/\|| || || |
Comment
> Hehe... > > > > - I wrote some kind of very tricky wizard with lots of subforms and more than > > one different ways of passing through the form > > - time ago I did such things like in whups/ticket/create.php - but > such a form > > isn't fun that way > > - I wrote a "XyWizardStep extends Horde_Form" class > > - and many "XyWizardStep_ChooseWhateverStep extends XyWizardStep" > > classes > > - I didn't call _preserveVarByPost() directly but have been calling > preserve() > > - there is finally one "XyWizard extends Horde_Form" class handling all > > the "business logic", finding out what path to take through the forms, > > running validations, navigating fore- and backward through the single > > steps and finally storing the whole big thing > > > > My problem: simply calling $form->preserve($vars) is useless - in my case > > it puts the hidden fields required for preserving vars in front of the whole > > html code because of the line in _preserveVarByPost() - mentioned > > before. > > > > I helped myself by "overwriting" addVariable() in my XyWizardStep class. > > My addVariable() function adds a pointer to every added var to an array > > named "_preserve_vars" - and a "getVarsToPreserve()" function gives me > > the possibility to walk through all vars in all Inactive single > forms, allowing > > me to add each of them as a hidden var to the last (currently active) form > > step. > > > > I consider this a bug - preserve() is a public function - and it shouldn't be > > up to the user / coder to find out that the function behaves only correct > > if you manually open and close form tags before / after calling preserve(). > > > > IMO preserve() should add all vars that should be preserved to an array, > > the rendering process should then take care of writing out the hidden > > input fields. > > > > Cheers, > > Thomas Gelf
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers