Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.148 -r1.149 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 18 Jul 2007 20:35:31 -0000 1.148 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 19 Jul 2007 22:06:15 -0000 1.149 @@ -16,7 +16,8 @@ -mime_type text/html \ -cr_attributes { if {[::xo::db::has_ltree]} { - ::Generic::Attribute new -attribute_name page_order -datatype text -sqltype ltree + ::Generic::Attribute new -attribute_name page_order -datatype text \ + -sqltype ltree -validator page_order } ::Generic::Attribute new -attribute_name creator -datatype text } \ @@ -824,6 +825,13 @@ } return $success } + Page instproc validate=page_order {value} { + if {[my exists page_order]} { + set page_order [string trim $value " ."] + my page_order $page_order + } + return 1 + } Page instproc update_references {page_id references} { db_dml [my qn delete_references] \ Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.87 -r1.88 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 19 Jul 2007 21:20:12 -0000 1.87 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 19 Jul 2007 22:06:15 -0000 1.88 @@ -483,9 +483,9 @@ instance attributes. } { set validation_errors 0 - set category_ids [list] - array set __ia [my set instance_attributes] + set category_ids [list] array set containers [list] + array set __ia [my set instance_attributes] # we have a form and get all form variables @@ -539,6 +539,9 @@ } } + # + # Run validators + # foreach f $form_fields { set validation_error [$f validate [self]] #my msg "validation of [$f name] with value '[$f value]' returns $validation_error"