Jump to:

1131 Posts in 1965 Topics by 402 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 1978 Views
  • Ricardona
    Avatar
    Community Member
    26 Posts

    Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error Link to this post

    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

  • neo67
    Avatar
    Community Member
    6 Posts

    Re: Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error Link to this post

    Hi Ricardona,

    how had you done the upgrade. Which steps?

    Greetz
    neo67

  • Ricardona
    Avatar
    Community Member
    26 Posts
  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error Link to this post

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

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

  • Ricardona
    Avatar
    Community Member
    26 Posts

    Re: Upgrading SilverStripe 2.4.2 to 2.4.3 Form.getExtraFields Fatal error Link to this post

    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

    1978 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.