If I'm not mistaken, $form->saveInto($post) and $post->write() should
be doing that work for you.
Sean
Sean Harvey | Developer
SilverStripe
http://silverstripe.com
Phone: +64 4 978 7330 ext 39
Skype: halkyon5
Level 3, 97-99 Courtenay Place
Wellington, New Zealand
$cats = $this->Categories();
if($cats) $catsSource = $cats->toDropDownMap('ID', 'Title');
This takes the 'ID' and 'Title' fields from the Category record, and
builds an array map of ID => Title for the dropdown source.
Not sure if this will have any effect on the current problem, but it's
a good way of formatting source data for dropdowns.
Also, to manually save the categories related data you can call $cats-
>add($category) where $category is a Category record you want to add
to the relation. add() is a method on ComponentSet you can call to
manage your relation. Likewise, you can use remove(). Not sure why
this isn't working by default on saveInto() though...
Cheers,
Sean