Bladeren bron

Erreur 500 : SubscriptionBuilder::deleteSubscription()

feature/souke
Guillaume Bourgeois 9 maanden geleden
bovenliggende
commit
e71197f79b
2 gewijzigde bestanden met toevoegingen van 21 en 10 verwijderingen
  1. +9
    -4
      backend/controllers/SubscriptionController.php
  2. +12
    -6
      producer/controllers/SubscriptionController.php

+ 9
- 4
backend/controllers/SubscriptionController.php Bestand weergeven

@@ -242,11 +242,16 @@ class SubscriptionController extends BackendController
$subscriptionModule = $this->getSubscriptionModule();
$orderModule = $this->getOrderModule();

$subscription = $subscriptionModule->findOneSubscriptionById($id);
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription);
$subscriptionModule->deleteSubscription($subscription);
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id);

$this->setFlash('success', 'Abonnement supprimé');
if($subscription) {
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription);
$subscriptionModule->deleteSubscription($subscription);
$this->setFlash('success', 'Abonnement supprimé');
}
else {
$this->setFlash('danger', 'Abonnement introuvable');
}

return $this->redirect(['subscription/index']);
}

+ 12
- 6
producer/controllers/SubscriptionController.php Bestand weergeven

@@ -227,14 +227,20 @@ class SubscriptionController extends ProducerBaseController
}

$subscriptionModule = $this->getSubscriptionModule();
$subscription = $subscriptionModule->findOneSubscriptionById($id);
$subscriptionModule->deleteSubscription($subscription);
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id);

if($subscription) {
$subscriptionModule->getBuilder()->deleteSubscription($subscription);
// @TODO : gérer via événements
$this->getSubscriptionModule()->getOrderManager()
->deleteOrdersIncomingDistributionsFromSubscription($subscription);

// @TODO : gérer via événements
$this->getSubscriptionModule()->getOrderManager()
->deleteOrdersIncomingDistributionsFromSubscription($subscription);
$this->setFlash('success', 'Abonnement supprimé');
}
else {
$this->setFlash('error', 'Abonnement introuvable');
}

$this->setFlash('success', 'Abonnement supprimé');

return $this->redirect(['subscription/index']);
}

Laden…
Annuleren
Opslaan