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.

All other Modules /

Discuss all other Modules here.

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

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


Go to End


2 Posts   1967 Views

Avatar
Raithlin

Community Member, 5 Posts

12 August 2010 at 6:57am

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.

Avatar
Raithlin

Community Member, 5 Posts

25 August 2010 at 10:48pm

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