diff --git a/composer.lock b/composer.lock index 90dba744fc23c..836d41f52cfb4 100644 --- a/composer.lock +++ b/composer.lock @@ -1074,16 +1074,16 @@ }, { "name": "joomla/database", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/database.git", - "reference": "98709eec31d9a3432611adc3c87a4c9a506279d9" + "reference": "142a624df2f48858467de67a4542d77807cc968b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/database/zipball/98709eec31d9a3432611adc3c87a4c9a506279d9", - "reference": "98709eec31d9a3432611adc3c87a4c9a506279d9", + "url": "https://api.github.com/repos/joomla-framework/database/zipball/142a624df2f48858467de67a4542d77807cc968b", + "reference": "142a624df2f48858467de67a4542d77807cc968b", "shasum": "" }, "require": { @@ -1138,7 +1138,7 @@ ], "support": { "issues": "https://github.com/joomla-framework/database/issues", - "source": "https://github.com/joomla-framework/database/tree/2.0.1" + "source": "https://github.com/joomla-framework/database/tree/2.0.2" }, "funding": [ { @@ -1150,7 +1150,7 @@ "type": "github" } ], - "time": "2021-12-10T11:53:59+00:00" + "time": "2022-01-10T02:28:52+00:00" }, { "name": "joomla/di", @@ -4752,7 +4752,11 @@ "TYPO3\\PharStreamWrapper\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Tobscure\\Tests\\JsonApi\\": "tests/" + } + }, "license": [ "MIT" ], diff --git a/libraries/src/Table/Nested.php b/libraries/src/Table/Nested.php index 8f8dbb728b4eb..653daefacda9a 100644 --- a/libraries/src/Table/Nested.php +++ b/libraries/src/Table/Nested.php @@ -547,13 +547,6 @@ public function delete($pk = null, $children = true) ); $this->getDispatcher()->dispatch('onBeforeDelete', $event); - // Lock the table for writing. - if (!$this->_lock()) - { - // Error message set in lock method. - return false; - } - // If tracking assets, remove the asset first. if ($this->_trackAssets) { @@ -562,35 +555,31 @@ public function delete($pk = null, $children = true) /** @var Asset $asset */ $asset = Table::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo())); - // Lock the table for writing. - if (!$asset->_lock()) - { - // Error message set in lock method. - return false; - } - if ($asset->loadByName($name)) { // Delete the node in assets table. if (!$asset->delete(null, $children)) { $this->setError($asset->getError()); - $asset->_unlock(); return false; } - - $asset->_unlock(); } else { $this->setError($asset->getError()); - $asset->_unlock(); return false; } } + // Lock the table for writing. + if (!$this->_lock()) + { + // Error message set in lock method. + return false; + } + // Get the node by id. $node = $this->_getNode($pk);