SyncruleController: Handle forms before processing the rule for content

This ensures we show the latest details on the sync rule, without need
to reload the view (reload was active before adding benchmark)
This commit is contained in:
Markus Frosch 2018-04-12 12:44:25 +02:00 committed by Thomas Gelf
parent c2fcd407cc
commit bd5e33ab11
1 changed files with 5 additions and 2 deletions

View File

@ -26,6 +26,9 @@ class SyncruleController extends ActionController
$ruleName = $rule->get('rule_name'); $ruleName = $rule->get('rule_name');
$this->addTitle($this->translate('Sync rule: %s'), $ruleName); $this->addTitle($this->translate('Sync rule: %s'), $ruleName);
$checkForm = SyncCheckForm::load()->setSyncRule($rule)->handleRequest();
$runForm = SyncRunForm::load()->setSyncRule($rule)->handleRequest();
if ($lastRunId = $rule->getLastSyncRunId()) { if ($lastRunId = $rule->getLastSyncRunId()) {
$run = SyncRun::load($lastRunId, $this->db()); $run = SyncRun::load($lastRunId, $this->db());
} else { } else {
@ -78,8 +81,8 @@ class SyncruleController extends ActionController
break; break;
} }
$c->add(SyncCheckForm::load()->setSyncRule($rule)->handleRequest()); $c->add($checkForm);
$c->add(SyncRunForm::load()->setSyncRule($rule)->handleRequest()); $c->add($runForm);
if ($run) { if ($run) {
$c->add(Html::h3($this->translate('Last sync run details'))); $c->add(Html::h3($this->translate('Last sync run details')));