
acaul at rand
Feb 3, 2009, 12:32 PM
Post #3 of 7
(1479 views)
Permalink
|
|
Re: copying categories from one story to another
[In reply to]
|
|
Ah, fantastic! That worked! Thank you so much. P.S. Yes, it is category objects. On Feb 3, 2009, at 2:40 PM, Greg Heo wrote: > Hi Ashlee, > > Try passing it in as an array reference: > $newstory->add_categories(\@cats); > > The API docs are a little inconsistent (one place says to pass an > array reference, another suggests not) but array reference will > always work. If @cats is made up of category IDs, then either > \@cats or @cats will work; I'm guessing @cats is made up of > category *objects* since you're getting the error. > > Best, > -Greg > > > On 3-Feb-09, at 1:29 PM, Ashlee Caul wrote: > >> I am trying to copy categories from one story to another. For >> each, I have whittled everything down to an array of categories to >> add to the new story. The array is valid and populated. My code >> looks like this. >> >> $newstory = $newstory->add_categories(@cats); >> $newstory->save(); > > --- > Greg Heo > web/software systems developer > greg [at] node79 > 416.826.7630 > > > __________________________________________________________________________ This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
|