Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 7 additions & 18 deletions libraries/src/Table/Nested.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);

Expand Down