Skip to content

Commit 081526b

Browse files
Merge pull request #75 from vmalyk/pimcore-11-support
Compatibility for Pimcore 11
2 parents 7720f1c + 48dbcef commit 081526b

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# Pimcore - Workflow GUI
22

33
## Requirements
4-
- Pimcore 10.0.x
4+
- Pimcore 10.6.x - 11.x
55

66
Workflow GUI adds a User Interface for configuring Pimcore Workflows.
77

88
## Getting started
9+
### Pimcore 10.6
910
* Install via composer ```composer require youwe/workflow-gui```
1011
* Enable via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:enable WorkflowGuiBundle```
1112
* Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install WorkflowGuiBundle```
1213
* Make sure that the Bundles generated config is loaded (config/config.yaml): ```../var/bundles/workflow-gui/workflow.yml```
1314

15+
### Pimcore 11
16+
* Install via composer ```composer require youwe/workflow-gui```
17+
* Make sure the bundle is enabled in the `config/bundles.php` file. The following lines should be added:
18+
```php
19+
return [
20+
// ...
21+
Youwe\Pimcore\WorkflowGui\WorkflowGuiBundle::class => ['all' => true],
22+
// ...
23+
];
24+
```
25+
* Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install WorkflowGuiBundle```
26+
* Make sure that the Bundles generated config is loaded (config/config.yaml): ```../var/bundles/workflow-gui/workflow.yml```
27+
1428
## Example workflow
1529
Put the workflow below in the following location ``var/bundles/workflow-gui/workflow.yml`` and change the class ``Pimcore\Model\DataObject\Test`` to the dataobject you want to apply it to.
1630
```yaml

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"require": {
2222
"php": "^8.0",
23-
"pimcore/pimcore": "^10.6.0"
23+
"pimcore/pimcore": "^10.6.0 || ^11.0"
2424
},
2525
"autoload": {
2626
"psr-4": {

src/WorkflowGui/Repository/WorkflowRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function ($key) use ($id) {
4949
public function updateConfig(callable $workflowsRewriter): void
5050
{
5151
$config = $this->loadConfig();
52-
$config['pimcore']['workflows'] = $workflowsRewriter($config['pimcore']['workflows']);
52+
$config['pimcore']['workflows'] = $workflowsRewriter($config['pimcore']['workflows'] ?? []);
5353
$this->storeConfig($config);
5454
}
5555

src/WorkflowGui/WorkflowGuiBundle.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,37 @@
1616

1717
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
1818
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
19+
use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
20+
use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait;
21+
use Pimcore\Extension\Bundle\Installer\InstallerInterface;
1922
use Youwe\Pimcore\WorkflowGui\Installer\WorkflowGuiInstaller;
2023

21-
class WorkflowGuiBundle extends AbstractPimcoreBundle
24+
class WorkflowGuiBundle extends AbstractPimcoreBundle implements PimcoreBundleAdminClassicInterface
2225
{
26+
use BundleAdminClassicTrait;
2327
use PackageVersionTrait;
2428

2529
protected function getComposerPackageName(): string
2630
{
2731
return 'youwe/workflow-gui';
2832
}
2933

30-
public function getNiceName()
34+
public function getNiceName(): string
3135
{
3236
return 'Workflow GUI';
3337
}
3438

35-
public function getDescription()
39+
public function getDescription(): string
3640
{
3741
return 'Provides a Graphical User Interface to define Pimcore Workflows';
3842
}
3943

40-
public function getInstaller()
44+
public function getInstaller(): ?InstallerInterface
4145
{
4246
return $this->container->get(WorkflowGuiInstaller::class);
4347
}
4448

45-
public function getJsPaths()
49+
public function getJsPaths(): array
4650
{
4751
return [
4852
'/bundles/workflowgui/js/pimcore/startup.js',
@@ -61,7 +65,7 @@ public function getJsPaths()
6165
];
6266
}
6367

64-
public function getCssPaths()
68+
public function getCssPaths(): array
6569
{
6670
return [
6771
'/bundles/workflowgui/css/workflow_gui.css'

0 commit comments

Comments
 (0)