mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-02 10:18:24 +00:00
Compare commits
3 Commits
v4.6.1
...
453-bug-cs
| Author | SHA1 | Date | |
|---|---|---|---|
| 36dfce6613 | |||
| 9c2abb2dfa | |||
| 94744b9542 |
7
.changes/unreleased/DX-20251027-150053.yaml
Normal file
7
.changes/unreleased/DX-20251027-150053.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
kind: DX
|
||||
body: |
|
||||
Send notifications log to dedicated channel, if it exists
|
||||
time: 2025-10-27T15:00:53.309372316+01:00
|
||||
custom:
|
||||
Issue: ""
|
||||
SchemaChange: No schema change
|
||||
6
.changes/unreleased/Fixed-20251029-143836.yaml
Normal file
6
.changes/unreleased/Fixed-20251029-143836.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
kind: Fixed
|
||||
body: 'Fix: export actions and their results in csv even when action does not have any goals attached to it.'
|
||||
time: 2025-10-29T14:38:36.195220844+01:00
|
||||
custom:
|
||||
Issue: "453"
|
||||
SchemaChange: No schema change
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\Notifier\Event\SentMessageEvent;
|
||||
final readonly class SentMessageEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
private LoggerInterface $notifierLogger, // will be send to "notifierLogger" if it exists
|
||||
) {}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
@@ -33,9 +33,9 @@ final readonly class SentMessageEventSubscriber implements EventSubscriberInterf
|
||||
$message = $event->getMessage();
|
||||
|
||||
if (null === $message->getMessageId()) {
|
||||
$this->logger->info('[sms] a sms message did not had any id after sending.', ['validReceiversI' => $message->getOriginalMessage()->getRecipientId()]);
|
||||
$this->notifierLogger->info('[sms] a sms message did not had any id after sending.', ['validReceiversI' => $message->getOriginalMessage()->getRecipientId()]);
|
||||
} else {
|
||||
$this->logger->warning('[sms] a sms was sent', ['validReceiversI' => $message->getOriginalMessage()->getRecipientId(), 'idsI' => $message->getMessageId()]);
|
||||
$this->notifierLogger->warning('[sms] a sms was sent', ['validReceiversI' => $message->getOriginalMessage()->getRecipientId(), 'idsI' => $message->getMessageId()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,28 +42,41 @@ final readonly class SocialActionCSVExportService
|
||||
$csv->insertOne($headers);
|
||||
|
||||
foreach ($actions as $action) {
|
||||
if ($action->getGoals()->isEmpty() && $action->getResults()->isEmpty() && $action->getEvaluations()->isEmpty()) {
|
||||
$hasGoals = !$action->getGoals()->isEmpty();
|
||||
$hasResults = !$action->getResults()->isEmpty();
|
||||
$hasEvaluations = !$action->getEvaluations()->isEmpty();
|
||||
|
||||
// If action has no goals, results, or evaluations, insert a single row
|
||||
if (!$hasGoals && !$hasResults && !$hasEvaluations) {
|
||||
$csv->insertOne($this->formatRow($action));
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($action->getGoals() as $goal) {
|
||||
if ($goal->getResults()->isEmpty()) {
|
||||
$csv->insertOne($this->formatRow($action, $goal));
|
||||
}
|
||||
|
||||
foreach ($goal->getResults() as $goalResult) {
|
||||
$csv->insertOne($this->formatRow($action, $goal, $goalResult));
|
||||
// Process goals and their results
|
||||
if ($hasGoals) {
|
||||
foreach ($action->getGoals() as $goal) {
|
||||
if ($goal->getResults()->isEmpty()) {
|
||||
$csv->insertOne($this->formatRow($action, $goal));
|
||||
} else {
|
||||
foreach ($goal->getResults() as $goalResult) {
|
||||
$csv->insertOne($this->formatRow($action, $goal, $goalResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($action->getResults() as $result) {
|
||||
if ($result->getGoals()->isEmpty()) {
|
||||
// Process results that are linked to this action (regardless of whether they have goals elsewhere)
|
||||
if ($hasResults && !$hasGoals) {
|
||||
foreach ($action->getResults() as $result) {
|
||||
$csv->insertOne($this->formatRow($action, null, null, $result));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($action->getEvaluations() as $evaluation) {
|
||||
$csv->insertOne($this->formatRow($action, evaluation: $evaluation));
|
||||
// Process evaluations
|
||||
if ($hasEvaluations) {
|
||||
foreach ($action->getEvaluations() as $evaluation) {
|
||||
$csv->insertOne($this->formatRow($action, evaluation: $evaluation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user