Replaced instances of new DataObjectSet() with new ArrayList()

Removed Validator::set_javascript_validation_handler() call
This commit is contained in:
edchipman@gmail.com 2012-04-22 16:25:26 -03:00 committed by Stig Lindqvist
parent 5de26cd897
commit ef3953fc68
3 changed files with 7 additions and 10 deletions

View File

@ -293,9 +293,6 @@ class UserDefinedForm_Controller extends Page_Controller {
public function init() { public function init() {
parent::init(); parent::init();
// block prototype validation
Validator::set_javascript_validation_handler('none');
// load the jquery // load the jquery
Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js'); Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js');
Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.min.js'); Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.min.js');
@ -314,14 +311,14 @@ class UserDefinedForm_Controller extends Page_Controller {
if($hasLocation) { if($hasLocation) {
$content = str_ireplace('$UserDefinedForm', $form->forTemplate(), $this->Content); $content = str_ireplace('$UserDefinedForm', $form->forTemplate(), $this->Content);
return array( return array(
'Content' => DBField::create('HTMLText', $content), 'Content' => DBField::create_field('HTMLText', $content),
'Form' => "" 'Form' => ""
); );
} }
} }
return array( return array(
'Content' => DBField::create('HTMLText', $this->Content), 'Content' => DBField::create_field('HTMLText', $this->Content),
'Form' => $this->Form() 'Form' => $this->Form()
); );
} }
@ -678,7 +675,7 @@ JS
$values = array(); $values = array();
$attachments = array(); $attachments = array();
$submittedFields = new DataObjectSet(); $submittedFields = new ArrayList();
foreach($this->Fields() as $field) { foreach($this->Fields() as $field) {

View File

@ -225,14 +225,14 @@ class EditableFormField extends DataObject {
* @return DataObjectSet * @return DataObjectSet
*/ */
public function CustomRules() { public function CustomRules() {
$output = new DataObjectSet(); $output = new ArrayList();
$fields = $this->Parent()->Fields(); $fields = $this->Parent()->Fields();
// check for existing ones // check for existing ones
if($rules = $this->Dependencies()) { if($rules = $this->Dependencies()) {
foreach($rules as $rule => $data) { foreach($rules as $rule => $data) {
// recreate all the field object to prevent caching // recreate all the field object to prevent caching
$outputFields = new DataObjectSet(); $outputFields = new ArrayList();
foreach($fields as $field) { foreach($fields as $field) {
$new = clone $field; $new = clone $field;
@ -471,6 +471,6 @@ class EditableFormField extends DataObject {
$errorMessage = ($this->CustomErrorMessage) ? $this->CustomErrorMessage : $standard; $errorMessage = ($this->CustomErrorMessage) ? $this->CustomErrorMessage : $standard;
return DBField::create('Varchar', $errorMessage); return DBField::create_field('Varchar', $errorMessage);
} }
} }

View File

@ -81,7 +81,7 @@ class EditableFormFieldTest extends FunctionalTest {
function testPopulateFromPostData() { function testPopulateFromPostData() {
$this->logInWithPermission('ADMIN'); $this->logInWithPermission('ADMIN');
$set = new DataObjectSet(); $set = new ArrayList();
$field = new EditableFormField(); $field = new EditableFormField();