Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Can't save on Account page


Go to End


1352 Views

Avatar
Rawbit

Community Member, 52 Posts

21 October 2009 at 5:02am

Edited: 21/10/2009 5:02am

Using the trunk of ecom, I can't save when on any users Account page. I get '"First Name" is required.' even though this field is filled. That happens when dev mode is off; when on, here's what I get:


[Notice] Undefined offset: 0
POST /account/MemberForm

Line 103 in /home/client/public_html/sapphire/forms/RequiredFields.php
Source

94 		$valid = true;
95 
96 		$fields = $this->form->Fields();
97 		foreach($fields as $field) {
98 			$valid = ($field->validate($this) && $valid);
99 		}
100 		if($this->required) {
101 			foreach($this->required as $fieldName) { 
102 				$formField = $fields->dataFieldByName($fieldName); 
103 				if($formField && !$data[$fieldName]) {
104 					$errorMessage = sprintf(_t('Form.FIELDISREQUIRED').'.', strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
105 					if($msg = $formField->getCustomValidationMessage()) {
106 						$errorMessage = $msg;
107 					}
108 					$this->validationError(
109 						$fieldName,

Trace

    * RequiredFields->php(Array)
      Line 106 of Validator.php
    * Validator->validate()
      Line 752 of Form.php
    * Form->validate()
      Line 189 of Form.php
    * Form->httpSubmission(HTTPRequest)
      Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
      Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 121 of Director.php
    * Director::direct(/account/MemberForm)
      Line 118 of main.php