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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error


Go to End
Reply


5 Posts   2297 Views

Avatar
Ricardona

Community Member, 26 Posts

14 November 2010 at 2:56am

Edited: 14/11/2010 10:13am

Hi all,

After upgrading to SilverStripe 2.4.3, i am getting the next error when display a form:

Fatal error: Call to a member function updateFieldSet() on a non-object in F:\xampp\xampp\htdocs\site\sapphire\forms\Form.php on line 445

For any reason the $token variable not have value, i modified the function as follow:

	....
	public function getExtraFields() {
		$extraFields = new FieldSet();
		
		$token = $this->getSecurityToken();

		if ($token) {
			$tokenField = $token->updateFieldSet($this->fields);
			if($tokenField) $tokenField->setForm($this);
			$this->securityTokenAdded = true;
		}
	....

I'm missing something ?

Thanks in advance

Ricardo

Avatar
neo67

Community Member, 6 Posts

18 November 2010 at 10:05pm

Hi Ricardona,

how had you done the upgrade. Which steps?

Greetz
neo67

Avatar
Ricardona

Community Member, 26 Posts

19 November 2010 at 2:33pm

Avatar
Ingo

Forum Moderator, 801 Posts

16 December 2010 at 10:12pm

Hm ... do you have a stacktrace for that? Please add this line in Form.php before the erroreous line:

if(!$token) SS_Backtrace::backtrace();

Avatar
Ricardona

Community Member, 26 Posts

20 December 2010 at 4:59pm

Edited: 20/12/2010 5:14pm

Hi Ingo,

stacktrace:


Form

  TextFieldTextField (Name: Descripción : ) =
  DropdownFieldDropdownField (ParentID: Ubicación Padre : ) =
  HiddenFieldHiddenField (CompanyID: CompanyID : ) = 6
  HiddenFieldHiddenField (ID: ID : ) =
  Validador

Name
Form->getExtraFields() 
  Line 466 of Form.php
Form->Fields() 
  Line 37 of xzValidator.php
xzValidator->setForm(Form) 
  Line 168 of Form.php
Form->__construct(GeographicalDivisionHolder_Controller,AddForm,FieldSet,FieldSet,Geograph_Validator) 
  Line 412 of xzPage.php
xzPage_Controller->AddForm() 
  Line 364 of xzPage.php
xzPage_Controller->add(SS_HTTPRequest) 
  Line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest) 
  Line 137 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest) 
  Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest) 
  Line 199 of ContentController.php
ContentController->handleRequest(SS_HTTPRequest) 
  Line 184 of ContentController.php
ContentController->handleRequest(SS_HTTPRequest) 
  Line 184 of ContentController.php
ContentController->handleRequest(SS_HTTPRequest) 
  Line 67 of ModelAsController.php
ModelAsController->handleRequest(SS_HTTPRequest) 
  Line 281 of Director.php
Director::handleRequest(SS_HTTPRequest,Session) 
  Line 124 of Director.php
Director::direct(/new-applicationholder/configuracion/geografico/add) 
  Line 127 of main.php

Thanks

Ricardo