Skip to content

Commit

Permalink
chore: Make graph visible in GUI, and show a proper error message
Browse files Browse the repository at this point in the history
Related to issue #65
  • Loading branch information
Joris Ros committed Jan 12, 2022
1 parent 7ed82ee commit 191e1d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Pimcore - Workflow GUI

> I, Dominik ([@pfaffenbauer](https://github.com/dpfaffenbauer)), will stop maintaining this form now on and will continue to work on this fork [https://github.com/cors-gmbh/pimcore-workflow-gui](https://github.com/cors-gmbh/pimcore-workflow-gui)
## Requirements
- Pimcore 10.0.x

Expand Down
7 changes: 6 additions & 1 deletion src/WorkflowGui/Controller/WorkflowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,14 @@ private function getVisualization($workflow, $format): string
throw new \InvalidArgumentException($this->trans('workflow_cmd_not_found', ['dot']));
}

$workflowRepository = $this->repository->find($workflow);

if ($workflowRepository && !$workflowRepository['enabled']) {
throw new \InvalidArgumentException($this->trans('workflow_gui_enable_message'));
}

$cmd = $php.' '.PIMCORE_PROJECT_ROOT.'/bin/console --env="${:arg_environment}" pimcore:workflow:dump "${:arg_workflow}" | '.$dot.' -T"${:arg_format}"';

$cmd = Console::addLowProcessPriority($cmd);
$process = Process::fromShellCommandline($cmd);
$process->run(null, [
'arg_environment' => $this->kernel->getEnvironment(),
Expand Down
1 change: 1 addition & 0 deletions src/WorkflowGui/Resources/translations/admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ workflow_gui: 'Workflow GUI'
workflow_problem_creating_workflow_invalid_characters: 'Please use only these characters: "a-z", "A-Z" and "_"'
workflow_gui_workflow_with_name_already_exists: 'Workflow with bane already exists'
workflow_gui_clone: 'Clone'
workflow_gui_enable_message: 'Please enable and save the workflow to display graph visualization.'

0 comments on commit 191e1d9

Please sign in to comment.