31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-03 22:20:48 +00:00

Check if there are any lables Fixes #297

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2020-10-10 10:52:20 +02:00
parent 18bdcc4f4d
commit e9c6b2e760
No known key found for this signature in database
GPG Key ID: E11DEC58660B9E9A

View File

@ -459,15 +459,15 @@ class PullsModel extends AbstractModel
return array('complete' => true);
}
$this->getDb()->setQuery(
$this->getDb()->getQuery(true)
->insert('#__patchtester_pulls')
->columns(['pull_id', 'title', 'description', 'pull_url', 'is_rtc', 'is_npm', 'branch'])
->values($data)
);
try
{
$this->getDb()->setQuery(
$this->getDb()->getQuery(true)
->insert('#__patchtester_pulls')
->columns(['pull_id', 'title', 'description', 'pull_url', 'is_rtc', 'is_npm', 'branch'])
->values($data)
);
$this->getDb()->execute();
}
catch (\RuntimeException $exception)
@ -482,30 +482,31 @@ class PullsModel extends AbstractModel
);
}
$this->getDb()->setQuery(
$this->getDb()->getQuery(true)
->insert('#__patchtester_pulls_labels')
->columns(['pull_id', 'name', 'color'])
->values($labels)
);
try
if ($labels)
{
$this->getDb()->execute();
}
catch (\RuntimeException $exception)
{
throw new \RuntimeException(
Text::sprintf(
'COM_PATCHTESTER_ERROR_INSERT_DATABASE',
$exception->getMessage()
),
$exception->getCode(),
$exception
);
try
{
$this->getDb()->setQuery(
$this->getDb()->getQuery(true)
->insert('#__patchtester_pulls_labels')
->columns(['pull_id', 'name', 'color'])
->values($labels)
);
$this->getDb()->execute();
}
catch (\RuntimeException $exception)
{
throw new \RuntimeException(
Text::sprintf(
'COM_PATCHTESTER_ERROR_INSERT_DATABASE',
$exception->getMessage()
),
$exception->getCode(),
$exception
);
}
}
// Need to make another request
return [
'complete' => false,
'page' => ($page + 1),