Forum OpenACS Q&A: Does form builder work in 4.6.3?

Collapse
Posted by Sean Redmond on

I'm still trying to solve the problem stated: here (I can't get my form to update records). Before I spent any more time on this, does form builder work in 4.6.3 (my current version) or is more of an OACS 5.x thing?

It seems to me that in order to process an update, a form has to pass the following test in ad_form:

if { [template::form is_valid $form_name] && ![uplevel #$level {set __refreshing_p}] } {
...

And is_valid requires that the submission flag be set:

upvar #$level $id:submission submission

  if { ! $submission } { 
	return 0 
  }

My form always fails this test in is_valid so it never gets as far as processing the edit_data block.

Why doesn't this submission flag ever get set.? It should happen in template::form create:

  # check whether this form is being submitted
  upvar #$level $id:submission submission

  if { [string equal $id request] } {
	# request is the magic ID for the form holding query parameters
	set submission 1
  } else {
	# If there's a form:id argument, and it's the ID of this form,
	# we're being submitted
	set submission [string equal $id [ns_queryget form:id]]
  }
But when my form is processed the value of $id is the name of the form, not "request" (this seems right), but there is no form:id argument either?

Maybe this is a bug that's been fixed since? Maybe my installation is broken?? Maybe I've gotten the above details wrong and it's somethiing else??? I'm stymied.