Forum OpenACS Q&A: Re: ad_form extend

Collapse
5: Re: ad_form extend (response to 1)
Posted by Brian Fenton on
I've just come across this problem too. I have an ad_form block with an extend that was working fine. When I add this to my ad_form:
-cancel_url $return_url \
-cancel_label $cancel_label \

I get the following error:
No "form" block has been specified for form "ReportForm"
while executing
"ad_form -name $form_id -method get -mode $form_mode -has_edit 1 -cancel_url $return_url -cancel_label cancel_label -export {ticket_id}"

Does anyone have a solution for this?

thanks
Brian

Collapse
6: Re: ad_form extend (response to 5)
Posted by Ryan Gallimore on
Hi Brian,

ad_form must include a -form switch, even if it is empty.

Try adding -form {} to the call.

Collapse
7: Re: ad_form extend (response to 6)
Posted by Brian Fenton on
Thanks Ryan. Now that is strange. As I said, everything was working perfectly until I added the -cancel_url. I didn't have a -form block in the initial form definition, and it was working fine.

Doing what you suggest, I'm now getting this error:
Key "report_id" has the value "724" but no select_query, select_query_name, or edit_request clause exists. (This can be caused by having ad_form request blocks in the wrong order.)
while executing
"ad_form -name $form_id -method get -mode $form_mode -has_edit 1 -cancel_url $return_url -cancel_label $cancel_label -export {ticket_id} -form {..."
("uplevel" body line 118)

The thing is, I DO have a select_query block in one of my extend blocks. So this has me totally confused.

So am I doing something wrong, or is this a bug in ad_form?