
bret at pectopah
Dec 7, 2011, 3:54 PM
Post #1 of 3
(445 views)
Permalink
|
Hi everybody, I think I might have a bit of insight into the desk-mismatch problem. Either that or I'm missing something. I'm trying to create a story within a template. When the initiating story contains a "tweet creator" subelement, the tweet creator template should create the tweet story and put it in workflow. This happens, and the asset gets its own workflow__id and desk__id values set correctly, but it does not get put in the relevant asset groups. So you see the asset in search results, and it increments the desk's asset count number in the UI, but when you go to the desk itself the tweet story is not visible. Below is the code from the tweet creator template. Any idea what else I could try? my $workflow = Bric::Biz::Workflow->lookup({name => 'Social'}); my $desk = Bric::Biz::Workflow::Parts::Desk->lookup({name => 'Social Publish'}); unless ($tweet) { my %starter_kit = ( 'user__id' => $story->get_user__id, 'priority' => $story->get_priority, 'title' => 'Tweet for ' . $story->get_title, 'workflow_id' => $workflow->get_id, 'slug' => $story->get_id, 'element_type' => Bric::Biz::ElementType->lookup({key_name => 'tweet'}), 'site_id' => $story->get_site_id, 'source__id' => $story->get_source__id, ); $tweet = Bric::Biz::Asset::Business::Story->new(\%starter_kit); $tweet->add_categories([$story->get_primary_category->get_id]); $tweet->set_primary_category($story->get_primary_category->get_id); $tweet->set_cover_date($story->get_cover_date), $tweet->save; $tweet->set_workflow_id($workflow->get_id); $desk->accept({asset => $tweet}); $desk->checkin($tweet); $tweet->save; } Thanks, Bret -- Bret Dawson Producer Pectopah Productions Inc. (416) 895-7635 bret [at] pectopah www.pectopah.com
|