Skip to content

Commit 9620844

Browse files
authored
Merge pull request #2 from pimcore/1.x
update fork
2 parents dc9862d + 0f949cf commit 9620844

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+966
-321
lines changed

.github/ci/files/bin/console

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,35 @@
1313
* @license http://www.pimcore.org/license GPLv3 and PEL
1414
*/
1515

16+
use Symfony\Component\Console\Input\InputInterface;
17+
1618
ob_get_clean();
1719

18-
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
20+
if (file_exists($a = getcwd() . '/vendor/autoload_runtime.php')) {
1921
include $a;
20-
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload.php')) {
22+
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload_runtime.php')) {
2123
include $a;
22-
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
24+
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload_runtime.php')) {
2325
include $a;
2426
} else {
2527
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
2628
exit(1);
2729
}
2830

29-
\Pimcore\Bootstrap::setProjectRoot();
30-
31-
define('PIMCORE_CONSOLE', true);
31+
return function (InputInterface $input) {
32+
define('PIMCORE_CONSOLE', true);
3233

34+
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
35+
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
36+
}
3337

34-
$input = new \Symfony\Component\Console\Input\ArgvInput();
35-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
36-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
37-
}
38-
39-
if ($input->hasParameterOption('--no-debug', true)) {
40-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
41-
}
38+
if ($input->hasParameterOption('--no-debug', true)) {
39+
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
40+
}
4241

43-
/** @var \Pimcore\Kernel $kernel */
44-
$kernel = \Pimcore\Bootstrap::startupCli();
45-
$application = new \Pimcore\Console\Application($kernel);
46-
$application->run();
42+
/** @var \Pimcore\Kernel $kernel */
43+
$kernel = \Pimcore\Bootstrap::startupCli();
44+
$application = new \Pimcore\Console\Application($kernel);
45+
$application->run();
46+
return $application;
47+
};

.github/ci/files/public/index_test.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,28 @@
1515
use Pimcore\Tool;
1616
use Symfony\Component\HttpFoundation\Request;
1717

18-
include __DIR__ . "/../vendor/autoload.php";
18+
include __DIR__ . "/../vendor/autoload_runtime.php";
1919

20-
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/..');
21-
define('APP_ENV', 'test');
20+
return function (array $context) {
21+
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/..');
22+
define('APP_ENV', 'test');
2223

23-
\Pimcore\Bootstrap::setProjectRoot();
24-
\Pimcore\Bootstrap::bootstrap();
25-
26-
$request = Request::createFromGlobals();
24+
$request = Request::createFromGlobals();
2725

2826
// set current request as property on tool as there's no
2927
// request stack available yet
30-
Tool::setCurrentRequest($request);
28+
Tool::setCurrentRequest($request);
3129

32-
/** @var \Pimcore\Kernel $kernel */
33-
$kernel = \Pimcore\Bootstrap::kernel();
30+
\Pimcore\Bootstrap::bootstrap();
31+
/** @var \Pimcore\Kernel $kernel */
32+
$kernel = \Pimcore\Bootstrap::kernel();
3433

3534
// reset current request - will be read from request stack from now on
36-
Tool::setCurrentRequest(null);
35+
Tool::setCurrentRequest(null);
3736

38-
$response = $kernel->handle($request);
39-
$response->send();
37+
$response = $kernel->handle($request);
38+
$response->send();
4039

41-
$kernel->terminate($request, $response);
40+
$kernel->terminate($request, $response);
41+
return $kernel;
42+
};

.github/workflows/codeception.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,21 @@ env:
2323
PIMCORE_PROJECT_ROOT: ${{ github.workspace }}
2424
APP_ENV: test
2525
PIMCORE_TEST: 1
26-
#PIMCORE_TEST_DB_DSN: "mysql://[email protected]:33006/pimcore_test"
26+
PIMCORE_TEST_DB_DSN: "mysql://[email protected]:33006/pimcore_test"
2727
PIMCORE_TEST_REDIS_DSN: "redis://127.0.0.1:63379"
2828

2929
jobs:
3030
codeception-tests:
3131
name: "Codeception tests"
3232
runs-on: "ubuntu-20.04"
3333
continue-on-error: ${{ matrix.experimental }}
34-
env:
35-
PIMCORE_TEST_DB_DSN: "mysql://[email protected]:33006/pimcore_test?serverVersion=${{ matrix.server_version }}"
3634
strategy:
3735
matrix:
3836
include:
39-
- { php-version: 8.0, database: "mariadb:10.7.7", server_version: "10.7.7-MariaDB-1:10.7.7+maria~ubu2004", dependencies: lowest, experimental: false, require_admin_bundle: false }
40-
- { php-version: 8.1, database: "mariadb:10.7.7", server_version: "10.7.7-MariaDB-1:10.7.7+maria~ubu2004", dependencies: highest, experimental: false, require_admin_bundle: true }
41-
- { php-version: 8.2, database: "mariadb:10.7.7", server_version: "10.7.7-MariaDB-1:10.7.7+maria~ubu2004", dependencies: highest, experimental: false, require_admin_bundle: true }
42-
- { php-version: 8.2, database: "mariadb:10.7.7", server_version: "10.7.7-MariaDB-1:10.7.7+maria~ubu2004", dependencies: highest, pimcore_version: "11.x-dev as 11.0.0", experimental: true, require_admin_bundle: true }
37+
- { php-version: 8.0, database: "mariadb:10.3", dependencies: lowest, experimental: false, require_admin_bundle: false }
38+
- { php-version: 8.1, database: "mariadb:10.11", dependencies: highest, experimental: false, require_admin_bundle: true }
39+
- { php-version: 8.2, database: "mariadb:10.11", dependencies: highest, experimental: false, require_admin_bundle: true }
40+
- { php-version: 8.2, database: "mariadb:10.11", dependencies: highest, pimcore_version: "11.x-dev as 11.0.0", experimental: true, require_admin_bundle: true }
4341
services:
4442
redis:
4543
image: redis

.github/workflows/stale.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Handle stale issues
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '37 7 * * *'
7+
8+
jobs:
9+
call-stale-workflow:
10+
uses: pimcore/workflows-collection-public/.github/workflows/[email protected]

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
"preferred-install": {
99
"pimcore/pimcore": "source",
1010
"*": "dist"
11+
},
12+
"allow-plugins": {
13+
"symfony/runtime": true
1114
}
1215
},
1316
"prefer-stable": true,
1417
"minimum-stability": "dev",
1518
"require": {
1619
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
17-
"pimcore/pimcore": "^10.6 || ^11.0",
20+
"pimcore/pimcore": "^10.6.8 || ^11.0.7",
1821
"pimcore/compatibility-bridge-v10": "^1.0",
1922
"webonyx/graphql-php": "^15.2.3"
2023
},
@@ -26,7 +29,8 @@
2629
"codeception/phpunit-wrapper": "^9",
2730
"codeception/module-asserts": "^2",
2831
"codeception/module-symfony": "^1.6.0 || ^3.1.0",
29-
"symfony/dotenv": "^6.2 || ^5.4.21"
32+
"symfony/dotenv": "^6.2 || ^5.4.21",
33+
"symfony/runtime": "^6.4 || ^5.4"
3034
},
3135
"suggest": {
3236
"pimcore/admin-ui-classic-bundle": "Required for Pimcore 11"
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Upgrade Notes
22

3+
## 1.7.0
4+
- [GraphQL] Deprecated SQL Condition.
5+
- [GraphQL] Added the possibility to disable deprecated SQL Condition.
6+
37
## 1.6.0
4-
- [General] If you want to use data-hub 1.6 and Pimcore 11, please make sure to require the `pimcore/admin-ui-classic-bundle`.
8+
- [General] If you want to use Datahub 1.6 and Pimcore 11, please make sure to require the `pimcore/admin-ui-classic-bundle`.
59
- [Config Location] Change default directory for configurations to `var/config/data_hub`
6-
- When using Pimcore 11 configurations from `datahub-configurations.php` are no longer used. To migrate those configurations
10+
- When using Pimcore 11, configurations from `datahub-configurations.php` are no longer used. To migrate those configurations
711
to the settings store, use the provided `datahub:configuration:migrate-legacy-config` command.
8-
- Added the ability to import and export each type of data-hub configuration.
12+
- Added the ability to import and export each type of Datahub configuration.
913
Be sure to include the `supported_types` configuration in any custom implementation to use the import functionality!
1014
- Added possibility to disable the introspection for GraphQL via configuration tree.
1115

1216
## 1.5.0
1317
- When "Skip Permission Check" is active in a GraphQL configuration, the "Workspaces" settings are also skipped
14-
- It is possible to add more than one API-key per configuration now. Therefore, the API-key gets stored as an array
18+
- It is possible to add more than one API key per configuration now. Therefore, the API keys get stored as an array
1519
in the configuration. Configurations from previous versions are still supported, but they get converted to the new format
1620
as soon as they get saved.
1721
- Added "Translation Listing" and "Translation" to the Generic Types

doc/02_Basic_Principle.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Basic Principle
22

3-
Pimcore Datahub allows defining multiple endpoints that allow data delivery and consumption. These
4-
endpoints are configured via so called configurations that can be added in Pimcore admin user interface:
3+
Pimcore Datahub allows defining multiple endpoints that allow data delivery and consumption. These endpoints are configured via so called configurations that can be added in the Pimcore admin user interface:
54

6-
## Adding a new configuration
5+
## Adding a New Configuration
76

8-
Open Datahub configuration panel
7+
1. Open the Datahub configuration panel:
98

109
![Configuration Overview](./img/graphql/configuration3.png)
1110

1211

13-
Choose endpoint technology
12+
2. Choose an endpoint technology:
1413

1514
![Add Configuration](./img/add_config.png)
1615

17-
And get the configuration done by defining
18-
- general settings
19-
- schema configuration
20-
- security definitions
21-
- and additional settings
16+
3. Get the configuration done by defining the followings:
17+
- General settings
18+
- Schema configuration
19+
- Security definitions
20+
- Additional settings
2221

23-
Example for [GraphQL](./10_GraphQL/README.md)
22+
Here you can find an example for [GraphQL](./10_GraphQL/README.md).

doc/10_GraphQL/01_Configuration/01_General_Settings.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@
44

55
#### Some Aspects:
66
* `Active`: You can temporarily disable the configuration using the checkbox.
7-
* `SQL Condition`: You can add a condition all data object queries have to satisfy in addition to
8-
the [workspace settings](./03_Security_Settings.md).
7+
* `SQL Condition (Deprecated)`: You can add a condition all data object queries have to satisfy in addition to
8+
the [workspace settings](./03_Security_Settings.md).
9+
10+
SQL Condition is currently deprecated but still enabled by default. If you want to disable it, you can do so in the symfony configuration tree:
11+
```
12+
pimcore_data_hub:
13+
graphql:
14+
allow_sqlObjectCondition: false
15+
```
16+
Please note that this option will be also removed in the next major version.
Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
# Schema Settings
22

3-
Schema settings define which data entities (Data Object classes, Assets, Documents) should be exposed via the endpoint. For Assets and Documents, default schemas are provided, for Data Object classes the schema can be defined in the field configuration.
3+
Schema settings define which data entities (Data Object classes, Assets, Documents) should be exposed via the endpoint. For Assets and Documents, default schemas are provided, for Data Object classes the schema can be defined in the field configuration.
44

55
![Add](../../img/graphql/schema_add.png)
66

7-
### Field Configuration
7+
## Query Schema
88

9-
Define all the fields that you want to make available. In addition, you can employ a set of operators.
9+
Here you can configure which Data Objects Classes can be exposed.
10+
11+
### Available Fields Configuration
12+
13+
When adding a new entity with the `Add` button, you can access the `Available Fields Configuration` window with a right-click on the `Settings` icon. You can then define all the target Data Object Class fields you want to make available.
14+
15+
In addition, you can employ a set of operators.
1016

1117
![Schema Settings](../../img/graphql/schema.png)
1218

1319
Please note that not all data types are supported yet!
14-
You will get a notice if you try to add an unsupported data type.
20+
You will get a notice if you try to add an unsupported data type.
21+
22+
## Mutation Schema
23+
24+
Here you can decide if Data Objects for the selected class can be created, updated or deleted from the endpoint.
25+
26+
:::caution
27+
28+
Be aware that a Data Object deleted from an endpoint will be definitively deleted of Pimcore.
29+
30+
:::
31+
32+
### Available Fields Configuration
33+
34+
As for the `Query Schema` field, you can select the fields you want to expose and/or make available for changes in the `Available Fields Configuration` you can open by clicking on the `Settings` icon.
35+
36+
## Generic Types
37+
38+
Here you can define which data types can be created, read, updated or deleted from an endpoint.
39+

doc/10_GraphQL/01_Configuration/03_Security_Settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Authentication
44

5-
Defines how users are authenticated when accessing the endpoint.
5+
Here you can define how users are authenticated when accessing the endpoint.
66

77
#### Supported Methods
88

doc/10_GraphQL/01_Configuration/04_Custom_Permissions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Custom Permissions
22

3-
When creating custom queries or creating other custom extensions to Datahub, it might be useful to
4-
add additional permissions to define access rules for certain data entities (like it is possible to
5-
define access for documents, assets, etc.).
3+
When creating custom queries or creating other custom extensions to Datahub, it might be useful to add additional permissions to define access rules for certain data entities (like it is possible to define access for Documents, Assets, etc.).
64

75
## Adding Custom Permissions
86

doc/10_GraphQL/04_Query/01_Document_Queries.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,51 @@
6969
}
7070
```
7171

72+
### Fetch Document Page and get processed Wysiwyg editable content
73+
74+
* Field `text` contains the HTML as it is stored in Pimcore for this Wysiwyg editable.
75+
* Field `frontend` contain the processed HTML where Pimcore Element links are rewritten where necessary.
76+
77+
```graphql
78+
{
79+
getDocument(id: 207) {
80+
... on document_page {
81+
id,
82+
editables(getInheritedValues: true){
83+
__typename
84+
...on document_editableWysiwyg {
85+
text
86+
frontend
87+
}
88+
}
89+
}
90+
}
91+
}
92+
```
93+
94+
### Fetch Full Rendered Document Page
95+
96+
The `rendered` field can be used to retrieve a rendered version of the page. Available options:
97+
* `attributes`: Attributes passed into the controller/action
98+
* `query`: Query Params passed into the controller/action
99+
* `options`: Options passed into the renderer
100+
* `use_layout`: Enable/disable Layout Rendering
101+
102+
```graphql
103+
{
104+
getDocument(id: 207) {
105+
... on document_page {
106+
id,
107+
rendered(
108+
attributes: [{key: "myControllerAttributeName", value: "Hello World!"}],
109+
use_layout: true,
110+
options: [{key: "ignore_errors", value: "1"}]
111+
)
112+
}
113+
}
114+
}
115+
```
116+
72117
## Fetch Document Page via Data Object Relation and Get More Editable Data
73118

74119
* get data object ID 61

0 commit comments

Comments
 (0)