Hi all,
While working on the classified-ads package and using ad_form, I came around a couple things that are puzzling me.
The first thing is that in my tests it seems that the -on_request block is executed every time, even if the form is being submitted. Is that true? If so, we should update the documentation to reflect that, because to my understanding it says otherwise.
Second issue:
classified-ads used form-builder calls directly. I changed some user and admin pages to use ad_form for several reasons. The package allows for custom fields, so there are a couple procs that grab those custom fields from acs_attributes and company and generate template::element::create calls.
I called these custom field procs from the -on_request block. ad_form happily displays and gets the values for these extra fields, but their variables are never made available in the other ad_form blocks (edit_request, edit_data, etc.).
Also, if I call template::element::exists those elements are not found. Reading ad_form's code, it seems that only the elements declared in the ad_form spec are made available. Is that true?
If so, is this an ad_form shortcoming that can be fixed? Or am I wrong and I should just modify the custom field procs to generate ad_form -extend calls outside any ad_form blocks (they are being executed every time anyways, because of the -on_request thing).
Thanks in advance.
-Roberto