Skip to content

Commit

Permalink
fixed creating article without issue and section via api
Browse files Browse the repository at this point in the history
  • Loading branch information
takeit committed Mar 30, 2015
1 parent 85e0d8f commit 17ffd70
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions newscoop/library/Newscoop/Services/ArticleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,17 @@ public function createArticle($articleType, $language, $user, $publication, $att
$article->setPublication($publication);
$article->setType($articleType);
$article->setCreator($user);
$article->setIssueId(0);
$article->setSectionId(0);
if (!is_null($issue)) {
$article->setIssueId($issue->getId());
$article->setIssue($issue);
}

$article->setIssueId((!is_null($issue)) ? $issue->getId() : 0);
$article->setSectionId((!is_null($section)) ? $section->getId() : 0);
$article->setIssue($issue);
$article->setSection($section);
if (!is_null($section)) {
$article->setSectionId($section->getId());
$article->setSection($section);
}

$this->updateArticleMeta($article, $attributes);

Expand Down

0 comments on commit 17ffd70

Please sign in to comment.