Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Unable to get multi-form to work using book examples and 2.4.0

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1128 Views
  • Raithlin
    Avatar
    Community Member
    5 Posts

    Unable to get multi-form to work using book examples and 2.4.0 Link to this post

    I've been working my way through the SS book (fantastic resource, by the way). To pick up what's changed over the past year (quite a bit, as it turns out), I'm using SS 2.4.0 as a base. As you may imagine, with the book's code tested against 2.3beta, this has turned out to be quite a challenge in places.

    I'm currently stuck in Chapter 6, section 4: Multi-Page Registration Form. Something isn't right, and I think it may have to do with changes to the Multi-Form module.

    The extended classes create fine using the existing code - no changes there - and I'm able to make it all the way through the section, up until I have to actually submit a form. I am able to see the first step (the book code walks you through creating a 2 page form), but when I submit the first step to the server, I get an error:

    [Fatal error: Call to a member function setForm() on a non-object in ~\sapphire\forms\Form.php on line 147]

    - stacktrace shows the error happened when MultiForm->__construct was called.

    Is this because the changes in the module have broken compatibility? I see the online documentation shows saving (finish()) picks up the data via SessionId, whereas the book code advocates $this->getSavedStepByClass('StepName').

    Further differences include the book using ->SaveInto($object) to save the details, but I can't get that far to test.

    If this is the case, then I can simply follow the online documentation to get it to work, and move on from there. If not, I need to know where I've gone wrong.

    I want to update the sample code online and upload it for others to learn from so I'd really appreciate any help you good folk can give. Thanks in advance.

  • Raithlin
    Avatar
    Community Member
    5 Posts

    Re: Unable to get multi-form to work using book examples and 2.4.0 Link to this post

    *BUMP*

    Is nobody able to help with this? I haven't had time to check it out myself (will be doing so this coming week, hopefully), but I was hoping for some guidance from the forums to light the way.

    1128 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.