33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-23 03:19:00 +00:00

Apply patch returns false positive (Fix #69)

This commit is contained in:
Michael Babker 2015-02-23 08:50:13 -05:00
parent 11c412e1e9
commit d8199d4b65
3 changed files with 10 additions and 6 deletions

View File

@ -33,9 +33,15 @@ class ApplyController extends DisplayController
// Initialize the state for the model
$model->setState($this->initializeState($model));
$model->apply($this->getInput()->getUint('pull_id'));
if ($model->apply($this->getInput()->getUint('pull_id')))
{
$msg = \JText::_('COM_PATCHTESTER_APPLY_OK');
}
else
{
$msg = \JText::_('COM_PATCHTESTER_NO_FILES_TO_PATCH');
}
$msg = \JText::_('COM_PATCHTESTER_APPLY_OK');
$type = 'message';
}
catch (\Exception $e)

View File

@ -164,10 +164,7 @@ class PullModel extends \JModelBase
if (!$files)
{
// TODO - Should be a better way to enqueue messages without needing the application...
\JFactory::getApplication()->enqueueMessage(\JText::_('COM_PATCHTESTER_NO_FILES_TO_PATCH', 'message'));
return true;
return false;
}
foreach ($files as $file)

View File

@ -40,6 +40,7 @@ COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION="Filter the list by title or ID."
COM_PATCHTESTER_HEADING_FETCH_DATA="Fetching GitHub Data"
COM_PATCHTESTER_PULL_ID="Pull ID"
COM_PATCHTESTER_NO_CREDENTIALS="No user credentials are saved, this will allow only 60 requests to the GitHub API per hour. Saving user credentials will allow 5,000 requests per hour."
COM_PATCHTESTER_NO_FILES_TO_PATCH="There are no files to patch from this pull request. This may mean that the files in the pull request are not present in your installation."
COM_PATCHTESTER_NO_ITEMS="No data has been retrieved from GitHub, please click the 'Fetch Data' button in the toolbar to retrieve the open pull requests."
COM_PATCHTESTER_NOT_APPLIED="Not Applied"
COM_PATCHTESTER_GITHUB="GitHub"