Fixed backend crash on tag editing

This commit is contained in:
Marcin Kurczewski 2014-11-03 13:07:34 +01:00
parent ff66ec2416
commit 703cc4724a

View file

@ -18,7 +18,7 @@ class TagService
private $tagDao; private $tagDao;
private $fileDao; private $fileDao;
private $timeService; private $timeService;
private $historyService; private $postHistoryService;
public function __construct( public function __construct(
Validator $validator, Validator $validator,
@ -26,7 +26,7 @@ class TagService
PostDao $postDao, PostDao $postDao,
TagDao $tagDao, TagDao $tagDao,
PublicFileDao $fileDao, PublicFileDao $fileDao,
HistoryService $historyService, PostHistoryService $postHistoryService,
TimeService $timeService) TimeService $timeService)
{ {
$this->validator = $validator; $this->validator = $validator;
@ -34,7 +34,7 @@ class TagService
$this->postDao = $postDao; $this->postDao = $postDao;
$this->tagDao = $tagDao; $this->tagDao = $tagDao;
$this->fileDao = $fileDao; $this->fileDao = $fileDao;
$this->historyService = $historyService; $this->postHistoryService = $postHistoryService;
$this->timeService = $timeService; $this->timeService = $timeService;
} }
@ -165,7 +165,7 @@ class TagService
{ {
$posts = $this->postDao->findByTagName($tag->getName()); $posts = $this->postDao->findByTagName($tag->getName());
foreach ($posts as $post) foreach ($posts as $post)
$this->historyService->saveSnapshot($this->historyService->getPostChangeSnapshot($post)); $this->postHistoryService->savePostChange($post);
}; };
$this->transactionManager->commit($transactionFunc); $this->transactionManager->commit($transactionFunc);
} }