Mm.
All I'm doing is grabbing the data from my form
$tip = Object::create('Tip');
$form->saveInto($tip);
and then doing
$tip->ClassName = "Tip";
$tip->Status = "Published";
$tip->Viewers = "Anyone";
$tip->ViewersGroup = 1;
$tip->ParentID = 2;
$tip->write();
$tip->publish("Live", "Stage");
If I do it the other way around like in the blog then I get fatal errors.
No I am not publishing it to the 'Stage' ... as far as I know. I did try doing
$tip->write();
$tip->writeToStage('Stage');
$tip->publish("Stage", "Live");
But that also gave a fatal error. (Notice I publish from stage to live there, what seems the most logical after writing to stage..)
I believe a very clear example of how this should be done with decent explanation would be great. It's working now but I'm not sure why.
Looks like when you do a 'write' on the 'frontend', which can be seen as the live site, things are written to the _Live tables. In that way it makes sense that you still have to publish from the live site to the stage site. That is what I'm making of it right now.
There must be some of you guys who know how this works?