From 5a4226413fc10ef6e65b2334c74c2c2670ef060c Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Thu, 13 Oct 2011 00:29:08 -0500 Subject: [PATCH] Fix Backup not created when deleting files --- administrator/components/com_patchtester/models/pull.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_patchtester/models/pull.php b/administrator/components/com_patchtester/models/pull.php index d62b17d..626e84f 100644 --- a/administrator/components/com_patchtester/models/pull.php +++ b/administrator/components/com_patchtester/models/pull.php @@ -25,7 +25,7 @@ class PatchtesterModelPull extends JModel protected function populateState() { // Initialise variables. - $app = JFactory::getApplication('administrator'); +// $app = JFactory::getApplication('administrator'); // Load the parameters. $params = JComponentHelper::getParams('com_patchtester'); @@ -33,7 +33,7 @@ class PatchtesterModelPull extends JModel $this->setState('github_user', $params->get('org')); $this->setState('github_repo', $params->get('repo')); - parent::populateState(); +// parent::populateState(); } @@ -140,7 +140,7 @@ class PatchtesterModelPull extends JModel foreach ($files AS $file) { // we only create a backup if the file already exists - if (file_exists(JPATH_ROOT . '/' . $file->new) && ($file->action == 'modified' || $file->action == 'deleted')) { + if ($file->action == 'deleted' || (file_exists(JPATH_ROOT . '/' . $file->new) && $file->action == 'modified')) { JFile::copy(JPath::clean(JPATH_ROOT . '/' . $file->old), JPATH_COMPONENT . '/backups/' . md5($file->old) . '.txt'); }