Procházet zdrojové kódy

Erreur 500 : SubscriptionBuilder::deleteSubscription()

feature/souke
Guillaume Bourgeois před 9 měsíci
rodič
revize
e71197f79b
2 změnil soubory, kde provedl 21 přidání a 10 odebrání
  1. +9
    -4
      backend/controllers/SubscriptionController.php
  2. +12
    -6
      producer/controllers/SubscriptionController.php

+ 9
- 4
backend/controllers/SubscriptionController.php Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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']);
}

Načítá se…
Zrušit
Uložit