Skip to content

Commit

Permalink
Remove logger
Browse files Browse the repository at this point in the history
zkabic committed Nov 13, 2023

Verified

This commit was signed with the committer’s verified signature.
Doctor-wu Doctor Wu
1 parent 786047e commit ed26112
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -28,15 +28,14 @@ public function __construct(SettingsManagerInterface $settingsManager, TenantCon

public function setUpdateAtDate(ArticleEvent $event): void
{
SwpLogger::log('Listener is in use :-) ....');
$article = $event->getArticle();
/**
* @var ?ArticleExtraTextField $dontUpdateDate
*/
$dontUpdateDate = $article->getExtraByKey('dont_change_updated_at') ?? null;
SwpLogger::log('Dont update date is type of: ' . gettype($dontUpdateDate));

if ($dontUpdateDate instanceof ArticleExtraTextField && strtolower($dontUpdateDate->getValue()) === 'on') {
SwpLogger::log('Dont update date: ' . $dontUpdateDate->getValue());

$article->cancelTimestampable();
}
}
2 changes: 0 additions & 2 deletions src/SWP/Bundle/CoreBundle/Service/ArticlePublisher.php
Original file line number Diff line number Diff line change
@@ -137,9 +137,7 @@ public function publish(PackageInterface $package, CompositePublishActionInterfa
$article->setPublishedToAppleNews($destination->isPublishedToAppleNews());
$this->eventDispatcher->dispatch(new GenericEvent($article), Events::SWP_VALIDATION);
$this->eventDispatcher->dispatch(new ArticleEvent($article, $package, ArticleEvents::PRE_UPDATE, $article->getRoute()), ArticleEvents::PRE_UPDATE);
SwpLogger::log('PRE_UPDATE before flush: ' . ($article->isTimestampableCanceled() ? 'Y' : 'N'));
$this->articleRepository->flush();
SwpLogger::log('PRE_UPDATE after flush: ' . ($article->isTimestampableCanceled() ? 'Y' : 'N'));

if ($destination->isPublished()) {
$this->eventDispatcher->dispatch(new ArticleEvent($article, $package, ArticleEvents::PUBLISH), ArticleEvents::PUBLISH);

0 comments on commit ed26112

Please sign in to comment.