Skip to content

Commit

Permalink
Fix batch (joomla#57)
Browse files Browse the repository at this point in the history
* Fix workflow batch
  • Loading branch information
bembelimen authored Apr 21, 2020
1 parent 68ceb20 commit be6b633
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Component\ComponentHelper;

$params = ComponentHelper::getParams('com_content');

$published = $this->state->get('filter.published');

Expand Down Expand Up @@ -42,7 +45,7 @@
<?php echo LayoutHelper::render('joomla.html.batch.tag', []); ?>
</div>
</div>
<?php if ($user->authorise('core.admin', 'com_content')) : ?>
<?php if ($user->authorise('core.admin', 'com_content') && $params->get('workflows_enable', 1)) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo LayoutHelper::render('joomla.html.batch.workflowstage', ['extension' => 'com_content']); ?>
Expand Down
8 changes: 4 additions & 4 deletions libraries/src/MVC/Model/WorkflowBehaviorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ protected function getStageForNewItem(Form $form, $data)
*
* @since 4.0.0
*/
public function batchWorkflowStage(int $value, array $pks, array $contexts) {

public function batchWorkflowStage(int $value, array $pks, array $contexts)
{
$user = Factory::getApplication()->getIdentity();
/** @var $workflow */

$workflow = Factory::getApplication()->bootComponent('com_workflow');

if (!$user->authorise('core.admin', $this->option))
Expand All @@ -429,7 +429,7 @@ public function batchWorkflowStage(int $value, array $pks, array $contexts) {
}

// Get workflow stage information
$stage = $workflow->createTable('Stage', 'Administrator');
$stage = $workflow->getMVCFactory()->createTable('Stage', 'Administrator');

if (empty($value) || !$stage->load($value))
{
Expand Down

0 comments on commit be6b633

Please sign in to comment.