Skip to content

Commit

Permalink
Fixing system tests and codestyle (joomla#80)
Browse files Browse the repository at this point in the history
* Fixing system tests and codestyle

* Fixing Postgres
  • Loading branch information
Hackwar authored and sakiss committed Oct 16, 2020
1 parent a96f47a commit 005df37
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,17 @@ public function getTransitions()
]
)
->from($db->quoteName('#__workflow_transitions', 't'))
->innerJoin($db->quoteName('#__workflow_stages', 's'))
->innerJoin(
$db->quoteName('#__workflow_stages', 's'),
$db->quoteName('t.to_stage_id') . ' = ' . $db->quoteName('s.id')
)
->where(
[
$db->quoteName('t.to_stage_id') . ' = ' . $db->quoteName('s.id'),
$db->quoteName('t.published') . ' = 1',
$db->quoteName('s.published') . ' = 1',
]
)
->order($db->quoteName('t.ordering'))
->group($db->quoteName('t.id'));
->order($db->quoteName('t.ordering'));

$where = [];

Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions libraries/src/Workflow/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,12 @@ public function getAssociation(int $item_id): ?\stdClass
]
)
->from($db->quoteName('#__workflow_associations', 'a'))
->innerJoin($db->quoteName('#__workflow_stages', 's'))
->innerJoin(
$db->quoteName('#__workflow_stages', 's'),
$db->quoteName('a.stage_id') . ' = ' . $db->quoteName('s.id')
)
->where(
[
$db->quoteName('a.stage_id') . ' = ' . $db->quoteName('s.id'),
$db->quoteName('item_id') . ' = :id',
$db->quoteName('extension') . ' = :extension',
]
Expand Down
3 changes: 2 additions & 1 deletion plugins/workflow/publishing/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ protected function enhanceItemForm(Form $form, $data)

$form->setFieldAttribute($fieldname, 'type', 'spacer');

$form->setFieldAttribute($fieldname, 'label', Text::sprintf('PLG_WORKFLOW_PUBLISHING_PUBLISHED', '<span class="text-' . $textclass . '">' . htmlentities($text, ENT_COMPAT, 'UTF-8') . '</span>'));
$label = '<span class="text-' . $textclass . '">' . htmlentities($text, ENT_COMPAT, 'UTF-8') . '</span>';
$form->setFieldAttribute($fieldname, 'label', Text::sprintf('PLG_WORKFLOW_PUBLISHING_PUBLISHED', $label));

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function unPublishArticle($title)
$I->checkAllResults();
$I->clickToolbarButton('Action');
$I->wait(2);
$I->clickToolbarButton('unpublish');
$I->clickToolbarButton('transition', '1');
$I->filterByCondition($title, "Unpublished");
}

Expand All @@ -144,7 +144,7 @@ public function publishArticle($title)
$I->checkAllResults();
$I->clickToolbarButton('Action');
$I->wait(2);
$I->clickToolbarButton('publish');
$I->clickToolbarButton('transition', '2');
$I->filterByCondition($title, "Published");
}

Expand All @@ -168,7 +168,7 @@ public function trashArticle($title)
$I->checkAllResults();
$I->clickToolbarButton('Action');
$I->wait(2);
$I->clickToolbarButton('trash');
$I->clickToolbarButton('transition', '3');
$I->filterByCondition($title, "Trashed");
}

Expand Down Expand Up @@ -210,7 +210,7 @@ public function filterByCondition($title, $condition)
$I = $this;
$I->click("//div[@class='js-stools-container-bar']//button[contains(text(), 'Filter')]");
$I->wait(2);
$I->selectOptionInChosenByIdUsingJs('filter_condition', $condition);
$I->selectOptionInChosenByIdUsingJs('filter_published', $condition);
$I->see($title);
}
}

0 comments on commit 005df37

Please sign in to comment.