mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Fix #1061 : Stories are not detached from WZ when databox are unmounted
This commit is contained in:
@@ -341,6 +341,8 @@ class databox extends base
|
||||
|
||||
public function unmount_databox(appbox $appbox)
|
||||
{
|
||||
$core = \bootstrap::getCore();
|
||||
|
||||
foreach ($this->get_collections() as $collection) {
|
||||
$collection->unmount_collection($appbox);
|
||||
}
|
||||
@@ -363,6 +365,16 @@ class databox extends base
|
||||
$n+=50;
|
||||
}
|
||||
|
||||
foreach ($core['EM']->getRepository('\Entities\StoryWZ')->findByDatabox($this) as $story) {
|
||||
$core['EM']->remove($story);
|
||||
}
|
||||
|
||||
foreach ($core['EM']->getRepository('\Entities\BasketElement')->findElementsByDatabox($this) as $element) {
|
||||
$core['EM']->remove($element);
|
||||
}
|
||||
|
||||
$core['EM']->flush();
|
||||
|
||||
$params = array(':site_id' => $this->get_registry()->get('GV_sit'));
|
||||
|
||||
$sql = 'DELETE FROM clients WHERE site_id = :site_id';
|
||||
|
Reference in New Issue
Block a user