Skip to content

Commit

Permalink
Pimcore 11 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Sep 21, 2023
1 parent 44c804b commit 5518c2c
Show file tree
Hide file tree
Showing 68 changed files with 280 additions and 330 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_DB_DSN: "mysql://test:test@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"
PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes/DataObject"

Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -82,9 +82,19 @@ jobs:
run: php -v

- name: Setup MySql
run: |
sudo systemctl start mysql
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
user: test
password: test
root-password: root
auto-start: true
my-cnf: |
max_allowed_packet=32505856
max_connections=1000
- name: Initial Database
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'

- name: Setup Chromium
run: |
Expand Down Expand Up @@ -115,7 +125,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand All @@ -117,4 +117,4 @@ jobs:
continue-on-error: true
run: |
bin/console cache:warmup --env=test
vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src/DsTrinityDataBundle --config ${{ github.workspace }}/lib/test-bundle/ecs.php
vendor/bin/ecs check ${{ github.workspace }}/lib/test-bundle/src --config ${{ github.workspace }}/lib/test-bundle/ecs.php
14 changes: 7 additions & 7 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Vagrantfile
php-cgi.core
.sass-cache

# codeception (only stage *.dist.yml config files)
/codeception.yml
/tests/codeception.yml
/tests/*.suite.yml
# codeception (only stage *.dist.yaml config files)
/codeception.yaml
/tests/codeception.yaml
/tests/*.suite.yaml
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# License
Copyright (C) 2021 DACHCOM.DIGITAL
Copyright (C) 2023 DACHCOM.DIGITAL

This software is available under the GNU General Public License version 3 (GPLv3).

Expand Down
96 changes: 40 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ Fetch pimcore elements by listings: `assets`, `documents` and `objects`.
## Release Plan
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------------|-------------------------------------------------------------------------------------------------|
| **2.x** | `10.0` - `10.6` | `^5.4` | 19.12.2021 | Yes (Bugs, Features) | master |
| **3.x** | `11.0` | `^6.2` | -- | Yes (Bugs, Features) | master |
| **2.x** | `10.0` - `10.6` | `^5.4` | 19.12.2021 | No | [1.x](https://github.com/dachcom-digital/pimcore-dynamic-search-data-provider-trinity/tree/2.x) |
| **1.x** | `6.6` - `6.9` | `^4.4` | 18.04.2021 | No | [1.x](https://github.com/dachcom-digital/pimcore-dynamic-search-data-provider-trinity/tree/1.x) |

***

## Installation
```json
"require" : {
"dachcom-digital/dynamic-search" : "~2.0.0",
"dachcom-digital/dynamic-search-data-provider-trinity" : "~2.0.0"
"dachcom-digital/dynamic-search" : "~3.0.0",
"dachcom-digital/dynamic-search-data-provider-trinity" : "~3.0.0"
}
```

Expand All @@ -29,7 +30,7 @@ You need to install / enable the Dynamic Search Bundle first.
Read more about it [here](https://github.com/dachcom-digital/pimcore-dynamic-search#installation).
After that, proceed as followed:

### Enabling via `config/bundles.php`:
Add Bundle to `bundles.php`:
```php
<?php

Expand All @@ -38,23 +39,6 @@ return [
];
```

### Enabling via `Kernel.php`:
```php
<?php

namespace App;

use Pimcore\HttpKernel\BundleCollection\BundleCollection;

class Kernel extends \Pimcore\Kernel
{
public function registerBundlesToCollection(BundleCollection $collection): void
{
$collection->addBundle(new \DsTrinityDataBundle\DsTrinityDataBundle());
}
}
```

***

## Publishing State
Expand Down Expand Up @@ -109,11 +93,11 @@ dynamic_search:

### full_dispatch

| Name | Default Value | Description |
|:-------------------------------------|:--------------|:------------|
|`asset_limit` | 0 | |
|`object_limit` | 0 | |
|`document_limit` | 0 | |
| Name | Default Value | Description |
|:-----------------|:--------------|:------------|
| `asset_limit` | 0 | |
| `object_limit` | 0 | |
| `document_limit` | 0 | |

***

Expand All @@ -128,10 +112,10 @@ Scaffold localized documents

Options:

| Name | Default Value | Allowed Type | Description |
|:------------------------------|:----------------------------------------|:----------------|:------------|
|`locales` | all pimcore enabled languages | array | |
|`skip_not_localized_documents` | true | bool | if false, an exception rises if a document/object has no valid locale |
| Name | Default Value | Allowed Type | Description |
|:-------------------------------|:------------------------------|:-------------|:----------------------------------------------------------------------|
| `locales` | all pimcore enabled languages | array | |
| `skip_not_localized_documents` | true | bool | if false, an exception rises if a document/object has no valid locale |

***

Expand Down Expand Up @@ -160,11 +144,11 @@ Returns element property.
Return Type: `string|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------|
|`property` | null | string | |
|`object_getter` | null | null|string | |
|`allow_inherited_value` | true | bool | |
| Name | Default Value | Allowed Type | Description |
|:------------------------|:--------------|:-------------|:------------|
| `property` | null | string | |
| `object_getter` | null | null | string |
| `allow_inherited_value` | true | bool | |


##### NormalizerValueCallback
Expand All @@ -174,9 +158,9 @@ Returns given option `value`.
Return Type: `string|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------|
|`value` | null | string | |
| Name | Default Value | Allowed Type | Description |
|:--------|:--------------|:-------------|:------------|
| `value` | null | string | |

##### ObjectGetterExtractor
Identifier: `object_getter_extractor`
Expand All @@ -185,12 +169,12 @@ Returns value of object getter.
Return Type: `bool|int|float|string|array|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------------------------------------------|
|`method` | id | string | |
|`arguments` | [] | array | |
|`clean_string` | true | bool | cleans HTML and whitespace (if value is string) |
|`transform_callback` | null | null\|closure | a callback function for further value transform |
| Name | Default Value | Allowed Type | Description |
|:---------------------|:--------------|:--------------|:------------------------------------------------|
| `method` | id | string | |
| `arguments` | [] | array | |
| `clean_string` | true | bool | cleans HTML and whitespace (if value is string) |
| `transform_callback` | null | null\|closure | a callback function for further value transform |

##### ObjectRelationsGetterExtractor
Identifier: `object_relations_getter_extractor`
Expand All @@ -199,11 +183,11 @@ Returns values of object relations getter.
Return Type: `array|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------|
|`relations` | null | string | |
|`method` | id | string | |
|`arguments` | [] | array | |
| Name | Default Value | Allowed Type | Description |
|:------------|:--------------|:-------------|:------------|
| `relations` | null | string | |
| `method` | id | string | |
| `arguments` | [] | array | |


##### ObjectPathGenerator
Expand All @@ -213,10 +197,10 @@ Returns object path generated by link generator.
Return Type: `string|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------|
|`arguments` | [] | array | |
|`fetch_object_for_variant` | false | bool | If true and object is type of `variant` the next parent gets fetched first until type `object` has been reached |
| Name | Default Value | Allowed Type | Description |
|:---------------------------|:--------------|:-------------|:----------------------------------------------------------------------------------------------------------------|
| `arguments` | [] | array | |
| `fetch_object_for_variant` | false | bool | If true and object is type of `variant` the next parent gets fetched first until type `object` has been reached |

##### DocumentMetaExtractor
Identifier: `document_meta_extractor`
Expand All @@ -225,9 +209,9 @@ Returns documents meta title or description.
Return Type: `string|null`
Options:

| Name | Default Value | Allowed Type | Description |
|:-----------------------------|:--------------|:---------------|:------------|
|`type` | title | string | Possible Types: `title` or `description` |
| Name | Default Value | Allowed Type | Description |
|:-------|:--------------|:-------------|:-----------------------------------------|
| `type` | title | string | Possible Types: `title` or `description` |

##### DocumentPathGenerator
Identifier: `document_path_generator`
Expand Down
23 changes: 3 additions & 20 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
# Upgrade Notes

## 2.0.2
- [BUGFIX] `object_relations_getter_extractor` respect arguments (#23)
- [FEATURE] `object_getter_extractor` more flexibility (#24)
- support mixed types
- `transform_callback` option

## 2.0.1
- [BUGFIX] Add null coalescing operator to `$options['asset_limit']` in `AssetListBuilder:getList()`
- [BUGFIX] Allow `null` as locale value `normalizer_value_callback`

## Migrating from Version 1.x to Version 2.0.0
## Migrating from Version 2.x to Version 3.0.0

### Global Changes
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
- `ProxyResolverInterface` (also the corresponding `ObjectProxyResolver` service) and tag `ds_trinity_data.proxy_resolver`has been removed, you have to use
the [resource validator](https://github.com/dachcom-digital/pimcore-dynamic-search/blob/master/docs/40_ResourceValidator.md) now:
- Method `checkResourceProxy` from `DataProviderService` has been removed
- Option `object_proxy_identifier` and `object_proxy_settings` in provider configuration have been removed
- Event `DataProxyEvent` via `DsTrinityDataEvents::PROXY_DEFAULT_DATA_OBJECT` has been removed
- The option `object_ignore_unpublished` and `object_ignore_unpublished` has [been removed](https://github.com/dachcom-digital/pimcore-dynamic-search-data-provider-trinity/issues/16)
- ⚠️ By default, unpublished elements will be fetched **by default**. Read more about this problematic fact [here](./docs/10_publishUnpublishedElements.md)
- Recommended folder structure by symfony adopted

***

1.x Upgrade Notes: https://github.com/dachcom-digital/dynamic-search-data-provider-trinity/blob/1.x/UPGRADE.md
2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-dynamic-search-data-provider-trinity/blob/2.x/UPGRADE.md
Loading

0 comments on commit 5518c2c

Please sign in to comment.