In a brand-new install, with only two sites added, and otherwise empty except for installed modules, when I try to delete one of the sites I get the following " ForeignKeyConstraintViolationException":
Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException
An exception occurred while executing 'DELETE FROM site WHERE id = ?' with params [2]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`cvlsites_devill`.`site_page`, CONSTRAINT `FK_2F900BD9F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`))
Details:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`cvlsites_devill`.`site_page`, CONSTRAINT `FK_2F900BD9F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`)) in /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
Stack trace:
#0 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL)
#1 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(596): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM sit...', Array, Array)
#3 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(580): Doctrine\DBAL\Connection->delete('site', Array, Array)
#4 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1094): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(Omeka\Entity\Site))
#5 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(406): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
#6 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#7 /var/www/dev/devill/application/src/Api/Adapter/AbstractEntityAdapter.php(425): Doctrine\ORM\EntityManager->flush()
#8 /var/www/dev/devill/application/src/Api/Manager.php(239): Omeka\Api\Adapter\AbstractEntityAdapter->delete(Object(Omeka\Api\Request))
#9 /var/www/dev/devill/application/src/Api/Manager.php(164): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#10 /var/www/dev/devill/application/src/Mvc/Controller/Plugin/Api.php(189): Omeka\Api\Manager->delete('sites', Array, Array, Array)
#11 /var/www/dev/devill/application/src/Controller/SiteAdmin/IndexController.php(416): Omeka\Mvc\Controller\Plugin\Api->delete('sites', Array)
#12 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\SiteAdmin\IndexController->deleteAction()
#13 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#16 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#17 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#18 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#20 /var/www/dev/devill/index.php(21): Zend\Mvc\Application->run()
#21 {main}
Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`cvlsites_devill`.`site_page`, CONSTRAINT `FK_2F900BD9F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`)) in /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107
Stack trace:
#0 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
#1 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(596): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM sit...', Array, Array)
#2 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(580): Doctrine\DBAL\Connection->delete('site', Array, Array)
#3 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1094): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(Omeka\Entity\Site))
#4 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(406): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /var/www/dev/devill/application/src/Api/Adapter/AbstractEntityAdapter.php(425): Doctrine\ORM\EntityManager->flush()
#7 /var/www/dev/devill/application/src/Api/Manager.php(239): Omeka\Api\Adapter\AbstractEntityAdapter->delete(Object(Omeka\Api\Request))
#8 /var/www/dev/devill/application/src/Api/Manager.php(164): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#9 /var/www/dev/devill/application/src/Mvc/Controller/Plugin/Api.php(189): Omeka\Api\Manager->delete('sites', Array, Array, Array)
#10 /var/www/dev/devill/application/src/Controller/SiteAdmin/IndexController.php(416): Omeka\Mvc\Controller\Plugin\Api->delete('sites', Array)
#11 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\SiteAdmin\IndexController->deleteAction()
#12 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#13 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#15 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#16 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#17 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#19 /var/www/dev/devill/index.php(21): Zend\Mvc\Application->run()
#20 {main}
Next Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException: An exception occurred while executing 'DELETE FROM site WHERE id = ?' with params [2]:
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`cvlsites_devill`.`site_page`, CONSTRAINT `FK_2F900BD9F6BD1646` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`)) in /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60
Stack trace:
#0 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1015): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'DELETE FROM sit...', Array)
#2 /var/www/dev/devill/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(596): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM sit...', Array, Array)
#3 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(580): Doctrine\DBAL\Connection->delete('site', Array, Array)
#4 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1094): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(Omeka\Entity\Site))
#5 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(406): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
#6 /var/www/dev/devill/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#7 /var/www/dev/devill/application/src/Api/Adapter/AbstractEntityAdapter.php(425): Doctrine\ORM\EntityManager->flush()
#8 /var/www/dev/devill/application/src/Api/Manager.php(239): Omeka\Api\Adapter\AbstractEntityAdapter->delete(Object(Omeka\Api\Request))
#9 /var/www/dev/devill/application/src/Api/Manager.php(164): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#10 /var/www/dev/devill/application/src/Mvc/Controller/Plugin/Api.php(189): Omeka\Api\Manager->delete('sites', Array, Array, Array)
#11 /var/www/dev/devill/application/src/Controller/SiteAdmin/IndexController.php(416): Omeka\Mvc\Controller\Plugin\Api->delete('sites', Array)
#12 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\SiteAdmin\IndexController->deleteAction()
#13 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#16 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#17 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#18 /var/www/dev/devill/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/dev/devill/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#20 /var/www/dev/devill/index.php(21): Zend\Mvc\Application->run()