Skip to content

Commit

Permalink
[Task] request explicit input source (#163)
Browse files Browse the repository at this point in the history
* request explicit input source

* Remove test logs

* Updated workflows and added docs

* Update according to feedback

* Update installation guide
  • Loading branch information
mattamon authored Nov 21, 2024
1 parent 3114b9d commit f8fe966
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
strategy:
matrix:
include:
- { php-version: 8.0, database: "mariadb:10.3", pimcore_version: "", dependencies: lowest, experimental: false, require_admin_bundle: false }
- { php-version: 8.1, database: "mariadb:10.11", pimcore_version: "", dependencies: highest, experimental: false, require_admin_bundle: true }
- { php-version: 8.2, database: "mariadb:10.11", pimcore_version: "11.x-dev as 11.0.0", dependencies: highest, experimental: true, require_admin_bundle: true }
- { php-version: 8.2, database: "mariadb:10.11", pimcore_version: "", dependencies: highest, experimental: false, require_admin_bundle: true }
- { php-version: 8.3, database: "mariadb:10.11", pimcore_version: "11.x-dev", dependencies: highest, experimental: true, require_admin_bundle: true }
services:
mariadb:
image: "${{ matrix.database }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
strategy:
matrix:
include:
- { php-version: "8.0", dependencies: "lowest", pimcore_version: "", phpstan_args: "", experimental: false, require_admin_bundle: false }
- { php-version: "8.1", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false, require_admin_bundle: true }
- { php-version: "8.1", dependencies: "highest", pimcore_version: "11.x-dev as 11.0.0", phpstan_args: "", experimental: true, require_admin_bundle: true }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false, require_admin_bundle: true }
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev", phpstan_args: "", experimental: true, require_admin_bundle: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ This bundle provides an editor for Pimcore to manage custom views and perspectiv
## Documentation Overview
- [Installation & Configuration](./doc/01_Installation.md)
- [Customize Menu Entry List](./doc/02_Customize_Menu_Entry_List.md)
- [Upgrade Notes](./doc/03_Upgrade.md)
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"minimum-stability": "dev",
"require": {
"pimcore/compatibility-bridge-v10": "^1.0",
"pimcore/pimcore": "^10.6 || ^11.0"
"pimcore/admin-ui-classic-bundle": "^1.0",
"pimcore/pimcore": "^11.2",
"symfony/http-foundation": "^6.3"
},
"require-dev": {
"phpstan/phpstan": "^1.2",
Expand All @@ -24,9 +26,6 @@
"codeception/phpunit-wrapper": "^9",
"codeception/module-asserts": "^2"
},
"suggest": {
"pimcore/admin-ui-classic-bundle": "Required for Pimcore 11"
},
"autoload": {
"psr-4": {
"Pimcore\\Bundle\\PerspectiveEditorBundle\\": "src/"
Expand Down
20 changes: 0 additions & 20 deletions doc/01_Installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Installation
## Bundle Installation
### For Pimcore >= 10.5 & \<= 10.6
To install Pimcore Perspective Editor for Pimcore 10.5 or higher, follow the three steps below:

1. Install the required dependencies:
```bash
Expand All @@ -27,23 +25,6 @@ return [
bin/console pimcore:bundle:install PimcorePerspectiveEditorBundle
```

### For Pimcore 11

You need to follow the steps mentioned above and additionally run the following command:

```bash
composer require pimcore/admin-ui-classic-bundle
```

### For Older Versions
To install the Perspective Editor bundle for older versions of Pimcore, please run the following commands instead:

```bash
composer require pimcore/perspective-editor
bin/console pimcore:bundle:enable PimcorePerspectiveEditorBundle
bin/console pimcore:bundle:install PimcorePerspectiveEditorBundle
```

Installation routine just adds an additional permission to `users_permission_definitions` table.

Also, make sure, that `customviews.php` and `perspectives.php` files are writeable for php.
Expand All @@ -53,7 +34,6 @@ They can be located at Pimcore default locations for config files:
If they don't exist, they are created at `PIMCORE_CONFIGURATION_DIRECTORY`.



## Configuration

To make the bundle work, just make sure, users have the necessary permissions.
Expand Down
5 changes: 5 additions & 0 deletions doc/03_Upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Update Notes

## Update to Version 1.8
### General
- Dropped support of Pimcore 10, bumped minimum requirement of `pimcore/pimcore` to `^11.2`. Replaced all `$request->get()` with their explicit input source.
8 changes: 4 additions & 4 deletions src/Controller/PerspectiveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public function updatePerspectivesAction(PerspectiveAccessor $perspectiveAccesso
'error' => null
];
try {
$treeStore = json_decode($request->get('data'), true);
$deletedRecords = json_decode($request->get('deletedRecords'), true);
$treeStore = json_decode($request->request->getString('data'), true);
$deletedRecords = json_decode($request->request->getString('deletedRecords'), true);
$this->checkForUniqueElements($treeStore);

$perspectiveAccessor->writeConfiguration($treeStore, $deletedRecords);
Expand Down Expand Up @@ -129,8 +129,8 @@ public function updateViewAction(ViewAccessor $viewAccessor, Request $request, C
'error' => null
];
try {
$treeStore = json_decode($request->get('data'), true);
$deletedRecords = json_decode($request->get('deletedRecords'), true);
$treeStore = json_decode($request->request->getString('data'), true);
$deletedRecords = json_decode($request->request->geString('deletedRecords'), true);

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3, highest, 11.x-dev, true, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3, highest, 11.x-dev, true, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3, highest, 11.x-dev, true, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().

Check failure on line 133 in src/Controller/PerspectiveController.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false, true)

Call to an undefined method Symfony\Component\HttpFoundation\InputBag::geString().
$viewAccessor->writeConfiguration($treeStore, $deletedRecords);
} catch (\Exception $e) {
$ret = ['success' => false, 'error' => $e->getMessage()];
Expand Down
14 changes: 1 addition & 13 deletions src/Resources/public/js/pimcore/perspective/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,4 @@ pimcore.events.postCreatePerspectiveEditorElementTreeTypeStore = "pimcore.perspe
/**
* fired after ElementTreeIcons Array was initialized
*/
pimcore.events.addPerspectiveEditorElementTreeIcon = 'pimcore.perspectiveEditor.elementTreeIcon.add';




//TODO: delete once support for Pimcore 10.6 is dropped
if(typeof addEventListenerCompatibilityForPlugins === "function") {
let eventMappings = [];
eventMappings["onPerspectiveEditorLoadPermissions"] = pimcore.events.onPerspectiveEditorLoadPermissions;
eventMappings["onPerspectiveEditorLoadStructureForPermissions"] = pimcore.events.onPerspectiveEditorLoadStructureForPermissions;
addEventListenerCompatibilityForPlugins(eventMappings);
console.warn("Deprecation: addEventListenerCompatibilityForPlugins will be not supported in Pimcore 11.");
}
pimcore.events.addPerspectiveEditorElementTreeIcon = 'pimcore.perspectiveEditor.elementTreeIcon.add';

0 comments on commit f8fe966

Please sign in to comment.