31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-03 14:10:47 +00:00

Added an additional condition to ignore the "apply by ci path" automatically if j3 is used. Fixed a bug where patches could be applied by the old patcher even if there are no files to patch, because they got ignored during parsing.

This commit is contained in:
Sebastian Enns 2019-09-23 15:33:46 +02:00
parent e7bf31b20e
commit 81f76e4251

View File

@ -156,7 +156,7 @@ class PullModel extends AbstractModel
$params = ComponentHelper::getParams('com_patchtester');
// Decide based on repository settings whether patch will be applied through Github or CIServer
if ((bool) $params->get('ci_switch', 1))
if (version_compare(JVERSION, "4", "ge") && (bool) $params->get('ci_switch', 1))
{
return $this->applyWithCIServer($id);
}
@ -366,6 +366,11 @@ class PullModel extends AbstractModel
$parsedFiles = $this->parseFileList($files);
if (!count($parsedFiles))
{
return false;
}
foreach ($parsedFiles as $file)
{
switch ($file->action)
@ -585,7 +590,7 @@ class PullModel extends AbstractModel
$params = ComponentHelper::getParams('com_patchtester');
// Decide based on repository settings whether patch will be applied through Github or CIServer
if ((bool) $params->get('ci_switch', 1) || $id === $this->getPatchChain($id)->insert_id)
if (version_compare(JVERSION, "4", "ge") && ((bool) $params->get('ci_switch', 1) || $id === $this->getPatchChain($id)->insert_id))
{
return $this->revertWithCIServer($id);
}