Skip to content

Commit

Permalink
Merge branch '4.0-dev' into remove-ftp-layer
Browse files Browse the repository at this point in the history
  • Loading branch information
roland-d committed Aug 11, 2018
2 parents 25e7410 + 464c2b5 commit 3da71bc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
20 changes: 10 additions & 10 deletions administrator/components/com_content/Model/ArticleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,22 @@ protected function batchWorkflowState($value, $pks, $contexts)

if (!$user->authorise('core.admin', 'com_content'))
{
$this->setError(\JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EXECUTE_TRANSITION'));
$this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EXECUTE_TRANSITION'));
}

// Get state information
$state = new StateTable($this->_db);

if (empty($value) || !$state->load($value))
{
Factory::getApplication()->enqueueMessage(\JText::sprintf('JGLOBAL_BATCH_WORKFLOW_STATE_ROW_NOT_FOUND'), 'error');
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_BATCH_WORKFLOW_STATE_ROW_NOT_FOUND'), 'error');

return false;
}

if (empty($pks))
{
Factory::getApplication()->enqueueMessage(\JText::sprintf('JGLOBAL_BATCH_WORKFLOW_STATE_ROW_NOT_FOUND'), 'error');
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_BATCH_WORKFLOW_STATE_ROW_NOT_FOUND'), 'error');

return false;
}
Expand Down Expand Up @@ -789,7 +789,7 @@ public function save($data)

if (empty($workflow->id))
{
$this->setError(\JText::_('COM_CONTENT_WORKFLOW_NOT_FOUND'));
$this->setError(Text::_('COM_CONTENT_WORKFLOW_NOT_FOUND'));

return false;
}
Expand All @@ -812,7 +812,7 @@ public function save($data)
// Check if the user is allowed to execute this transition
if (!$user->authorise('core.execute.transition', 'com_content.transition.' . (int) $data['transition']))
{
$this->setError(JText::_('COM_CONTENT_WORKFLOW_TRANSITION_NOT_ALLOWED'));
$this->setError(Text::_('COM_CONTENT_WORKFLOW_TRANSITION_NOT_ALLOWED'));

return false;
}
Expand All @@ -832,7 +832,7 @@ public function save($data)

if (empty($state->id))
{
$this->setError(JText::_('COM_CONTENT_WORKFLOW_TRANSITION_NOT_ALLOWED'));
$this->setError(Text::_('COM_CONTENT_WORKFLOW_TRANSITION_NOT_ALLOWED'));

return false;
}
Expand Down Expand Up @@ -903,7 +903,7 @@ public function save($data)

if (empty($workflow->id))
{
$this->setError(\JText::_('COM_CONTENT_WORKFLOW_NOT_FOUND'));
$this->setError(Text::_('COM_CONTENT_WORKFLOW_NOT_FOUND'));

return false;
}
Expand Down Expand Up @@ -1269,8 +1269,8 @@ protected function getWorkflowByCategory($catId)
/**
* Runs transition for item.
*
* @param array $pk Id of article
* @param array $transition_id Id of transition
* @param integer $pk Id of article
* @param integer $transition_id Id of transition
*
* @return boolean
*
Expand All @@ -1284,7 +1284,7 @@ public function runTransition($pk, $transition_id)

if (!$runTransaction)
{
$this->setError(\JText::_('COM_CONTENT_ERROR_UPDATE_STATE'));
$this->setError(Text::_('COM_CONTENT_ERROR_UPDATE_STATE'));

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_workflow/Table/StateTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Joomla\CMS\Language\Text;

/**
* Category table
* State table
*
* @since __DEPLOY_VERSION__
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Joomla\CMS\Table\Table;

/**
* Category table
* Transition table
*
* @since __DEPLOY_VERSION__
*/
Expand Down
24 changes: 11 additions & 13 deletions administrator/components/com_workflow/Table/WorkflowTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Joomla\CMS\Language\Text;

/**
* Category table
* Workflow table
*
* @since __DEPLOY_VERSION__
*/
Expand All @@ -42,7 +42,7 @@ public function __construct(\JDatabaseDriver $db)
*
* @param int $pk Extension ids to delete.
*
* @return void
* @return boolean
*
* @since __DEPLOY_VERSION__
*
Expand All @@ -58,7 +58,7 @@ public function delete($pk = null)
$db = $this->getDbo();
$app = Factory::getApplication();

// Gets the update site names.
// Gets the workflow information that is going to be deleted.
$query = $db->getQuery(true)
->select($db->quoteName(array('id', 'title')))
->from($db->quoteName('#__workflows'))
Expand All @@ -73,7 +73,7 @@ public function delete($pk = null)
return false;
}

// Delete the update site from all tables.
// Delete the workflow states, then transitions from all tables.
try
{
$query = $db->getQuery(true)
Expand All @@ -94,10 +94,8 @@ public function delete($pk = null)
{
$app->enqueueMessage(Text::sprintf('COM_WORKFLOW_MSG_WORKFLOWS_DELETE_ERROR', $workflow->title, $e->getMessage()), 'error');

return;
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -257,15 +255,15 @@ protected function _getAssetParentId(Table $table = null, $id = null)
$assetId = null;

// Build the query to get the asset id for the parent category.
$query = $this->_db->getQuery(true)
->select($this->_db->quoteName('id'))
->from($this->_db->quoteName('#__assets'))
->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote($this->extension));
$query = $this->getDbo()->getQuery(true)
->select($this->getDbo()->quoteName('id'))
->from($this->getDbo()->quoteName('#__assets'))
->where($this->getDbo()->quoteName('name') . ' = ' . $this->getDbo()->quote($this->extension));

// Get the asset id from the database.
$this->_db->setQuery($query);
$this->getDbo()->setQuery($query);

if ($result = $this->_db->loadResult())
if ($result = $this->getDbo()->loadResult())
{
$assetId = (int) $result;
}
Expand Down
4 changes: 2 additions & 2 deletions build/build-modules-js/compile-es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const compileFile = (filePath) => {
const fileName = filePath.slice(0, -7);
console.log(`Compiling: ${fileName.replace('/build/media_src/', '/media/')}.js`);
fs.writeFile(
`${fileName.replace('/build/media_src/', '/media/')}.js`,
`${fileName.replace('/build/media_src/', '/media/').replace('\\build\\media_src\\', '\\media\\')}.js`,
result.code + os.EOL,
(fsError) => {
if (fsError) {
Expand All @@ -39,7 +39,7 @@ const compileFile = (filePath) => {
);
// Also write the minified
fs.writeFile(
`${fileName.replace('/build/media_src/', '/media/')}.min.js`,
`${fileName.replace('/build/media_src/', '/media/').replace('\\build\\media_src\\', '\\media\\')}.min.js`,
UglifyJS.minify(result.code).code + os.EOL,
(fsError) => {
if (fsError) {
Expand Down

0 comments on commit 3da71bc

Please sign in to comment.