Skip to content

Commit 093c681

Browse files
authored
Pimcore 6.5 compatibility (#131)
* Pimcore 6.5 compatibility * fix some notice exceptions * set error level
1 parent 0622358 commit 093c681

26 files changed

+191
-104
lines changed

.travis.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@ env:
1818
- SYMFONY_DEPRECATIONS_HELPER=weak
1919
- DACHCOM_TEST_SECTION=codeception
2020
- SYMFONY_VERSION=^4.0
21+
- PIMCORE_PHP_ERROR_REPORTING=32767 # E_ALL
2122
matrix:
2223
include:
23-
- name: "PHPStan Static Analysis (Pimcore 6.3.x, Symfony ^4.0, PHP 7.3)"
24+
- name: "PHPStan Static Analysis (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
2425
sudo: required
25-
php: 7.3
26+
php: 7.4
2627
env:
27-
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
28+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
2829
- DACHCOM_TEST_SECTION=phpstan
29-
- name: "PHP ECS (Pimcore 6.3.x, Symfony ^4.0, PHP 7.3)"
30+
- name: "PHP ECS (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
3031
sudo: required
31-
php: 7.3
32+
php: 7.4
3233
env:
33-
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
34+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
3435
- DACHCOM_TEST_SECTION=ecs
3536
- name: "Codeception Tests (Pimcore 6.0.x, Symfony ^4.3, PHP 7.3)"
3637
sudo: required
@@ -50,25 +51,36 @@ matrix:
5051
env:
5152
- SYMFONY_VERSION="~4.3.0"
5253
- PIMCORE_SKELETON_BRANCH="tags/v2.2.0"
53-
- name: "Codeception Tests (Pimcore 6.3.x, Symfony ^4.0, PHP 7.2)"
54+
- name: "Codeception Tests (Pimcore 6.3.x, Symfony ^4.0, PHP 7.3)"
5455
sudo: required
55-
php: 7.2
56+
php: 7.3
5657
env:
58+
- PIMCORE_PHP_ERROR_REPORTING=30711 # E_ALL & ~E_NOTICE & ~E_STRICT
5759
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
58-
- name: "Codeception Tests (Pimcore 6.3.x, Symfony ^4.0, PHP 7.3)"
60+
- name: "Codeception Tests (Pimcore 6.4.x, Symfony ^4.0, PHP 7.3)"
5961
sudo: required
6062
php: 7.3
6163
env:
62-
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
63-
- name: "Codeception Tests (Pimcore 6.3.x, Symfony ^3.4, PHP 7.3)"
64+
- PIMCORE_SKELETON_BRANCH="tags/v2.4.0"
65+
- name: "Codeception Tests (Pimcore 6.5.x, Symfony ^4.0, PHP 7.3)"
66+
sudo: required
67+
php: 7.3
68+
env:
69+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
70+
- name: "Codeception Tests (Pimcore 6.5.x, Symfony ^3.4, PHP 7.3)"
6471
sudo: required
6572
php: 7.3
6673
env:
6774
- SYMFONY_VERSION=^3.4
68-
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
75+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
76+
- name: "Codeception Tests (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
77+
sudo: required
78+
php: 7.4
79+
env:
80+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
6981
allow_failures:
7082
- env:
71-
- PIMCORE_SKELETON_BRANCH="tags/v2.3.0"
83+
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
7284
- DACHCOM_TEST_SECTION=ecs
7385
fast_finish: true
7486

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ The Toolbox is a Kickstarter for your every day project. It provides some import
1515

1616
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
1717
|---------|-----------------------------------|----------------------------|--------------|----------------|------------|
18-
| **3.x** | `6.0` - `6.3` | `3.4`, `^4.0` | 16.07.2019 | Feature Branch | master |
18+
| **3.x** | `6.0` - `6.5` | `3.4`, `^4.0` | 16.07.2019 | Feature Branch | master |
1919
| **2.8** | `5.4`, `5.5`, `5.6`, `5.7`, `5.8` | `3.4` | 30.06.2019 | Bugfix only | 2.8 |
2020
| **1.8** | `4.0` | -- | 28.04.2017 | Unsupported | pimcore4 |
2121

2222
### Installation
2323

2424
```json
2525
"require" : {
26-
"dachcom-digital/toolbox" : "~3.1.0"
26+
"dachcom-digital/toolbox" : "~3.2.0"
2727
}
2828
```
2929

UPGRADE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
After every update you should check the pimcore extension manager.
77
Just click the "update" button or execute the migration command to finish the bundle update.
88

9+
#### Update from Version 3.1.x to Version 3.2.0
10+
- **[NEW FEATURE]**: Pimcore 6.4.0 and Pimcore 6.5.0 ready
11+
912
#### Update from Version 3.x to Version 3.1.0
1013
- **[NEW FEATURE]**: Pimcore 6.3.0 ready
1114
- **[BUG FIX]**: [Fix wrong index in bootstrap tabs for active element](https://github.com/dachcom-digital/pimcore-toolbox/issues/119)

src/ToolboxBundle/Builder/BrickConfigBuilder.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,15 @@ private function checkDependingSystemField($configElementName, $configFields)
515515

516516
$parsedTagConfig = ['reload' => false];
517517
$additionalConfig = [
518-
'type' => 'columnadjuster',
519-
'editmode_hidden' => false,
520-
'col_class' => '',
521-
'name' => 'columnadjuster',
522-
'title' => null,
523-
'edit_reload' => false,
518+
'type' => 'columnadjuster',
519+
'editmode_hidden' => false,
520+
'col_class' => '',
521+
'name' => 'columnadjuster',
522+
'title' => null,
523+
'edit_reload' => false,
524+
'additional_classes_element' => false
524525
];
526+
525527
$configFields[] = ['tag_config' => $parsedTagConfig, 'additional_config' => $additionalConfig];
526528
}
527529

src/ToolboxBundle/Controller/AjaxController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function videoGetTypesAction(Request $request, ConfigManagerInterface $co
5050
'name' => $name,
5151
'value' => $name,
5252
'config' => [
53-
'allow_lightbox' => $settings['allow_lightbox'],
54-
'id_label' => $settings['id_label']
53+
'allow_lightbox' => $settings['allow_lightbox'] ?? false,
54+
'id_label' => $settings['id_label'] ?? null
5555
]
5656
];
5757
}

src/ToolboxBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function getConfigNode(NodeDefinition $rootNode)
245245
->end()
246246
->end()
247247
->arrayNode('area_block_configuration')
248+
->addDefaultsIfNotSet()
248249
->children()
249250
->arrayNode('toolbar')
250251
->children()

src/ToolboxBundle/Manager/AreaManager.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,14 @@ private function getAvailableBricks($type = null)
180180
{
181181
$areaElements = $this->getActiveBricks();
182182

183-
// @deprecated: remove in 4.0
184-
$disallowedSubAreas = $this->configManager->getConfig('disallowed_subareas');
183+
try {
184+
// @deprecated: remove in 4.0
185+
$disallowedSubAreas = $this->configManager->getConfig('disallowed_subareas');
186+
} catch (\Exception $e) {
187+
// skip notice exceptions: this node is allowed to be missed!
188+
$disallowedSubAreas = [];
189+
}
190+
185191
$depElementDisallowed = isset($disallowedSubAreas[$type]) ? $disallowedSubAreas[$type]['disallowed'] : [];
186192

187193
$areaAppearance = $this->configManager->getConfig('areas_appearance');
@@ -229,8 +235,13 @@ private function getAvailableBricksForSnippets($type)
229235
{
230236
$areaElements = $this->getActiveBricks();
231237

232-
// @deprecated: remove in 4.0
233-
$disallowedSubAreas = $this->configManager->getConfig('disallowed_content_snippet_areas');
238+
try {
239+
// @deprecated: remove in 4.0
240+
$disallowedSubAreas = $this->configManager->getConfig('disallowed_content_snippet_areas');
241+
} catch (\Exception $e) {
242+
// skip notice exceptions: this node is allowed to be missed!
243+
$disallowedSubAreas = [];
244+
}
234245

235246
$areaAppearance = $this->configManager->getConfig('snippet_areas_appearance');
236247
$elementAllowed = isset($areaAppearance[$type]) ? $areaAppearance[$type]['allowed'] : [];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
{% set editmode = editmode is defined ? editmode : null %}
12
{{ toolbox_document_tag(type, tag_name, tag_config) }}

src/ToolboxBundle/Resources/views/Helper/areablock.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% set block_name = name ? name : 'default' %}
22
{% set block_type = type ? type : null %}
33
{% set block_config = toolbox_areablock_config(block_type) %}
4+
{% set editmode = editmode is defined ? editmode : null %}
45

56
{% if block_config.allowed|length > 0 %}
67
{{ pimcore_areablock('c' ~ block_name, block_config) }}

src/ToolboxBundle/Resources/views/Snippet/teaser-default.html.twig

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
{% set linkTarget = null %}
66

77
{% if useDynamicLinks == true %}
8-
{% set hasLink = pimcore_dynamiclink('link').isEmpty() == false %}
9-
{% set link = hasLink ? pimcore_dynamiclink('link').getHref() : null %}
10-
{% set linkTarget = hasLink ? pimcore_dynamiclink('link').getTarget() : null %}
8+
{% set linkElement = pimcore_dynamiclink('link') %}
9+
{% set hasLink = linkElement.isEmpty() == false %}
10+
{% set linkElementData = hasLink ? linkElement.data : [] %}
11+
{% set link = hasLink ? linkElement.href : null %}
12+
{% set linkTarget = hasLink and linkElementData.target is defined ? linkElement.target : null %}
1113
{% else %}
12-
{% set hasLink = pimcore_link('link', {'class' : 'btn btn-default teaser-link'}).isEmpty() == false %}
13-
{% set link = hasLink ? pimcore_link('link').getHref() : null %}
14-
{% set linkTarget = hasLink ? pimcore_link('link').getTarget() : null %}
14+
{% set linkElement = pimcore_link('link') %}
15+
{% set hasLink = linkElement.isEmpty() == false %}
16+
{% set linkElementData = hasLink ? linkElement.data : [] %}
17+
{% set link = hasLink ? linkElement.href : null %}
18+
{% set linkTarget = hasLink and linkElementData.target is defined ? linkElement.target : null %}
1519
{% endif %}
1620

1721
<div class="single-teaser default {{ useLightBox ? 'light-box' : '' }}">

0 commit comments

Comments
 (0)