Skip to content

Commit

Permalink
request explicit input source
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Nov 21, 2024
1 parent 3114b9d commit f916818
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
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);
$viewAccessor->writeConfiguration($treeStore, $deletedRecords);
} catch (\Exception $e) {
$ret = ['success' => false, 'error' => $e->getMessage()];
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/public/js/pimcore/perspective/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@


pimcore.registerNS('pimcore.settings.perspectiveview');

console.log("test");
pimcore.settings.perspectiveview = Class.create({

panelId: 'perspective_view_panel_id',

initialize: function () {
console.log("here");
// if the new event exists, we use this
if (pimcore.events.preMenuBuild) {
console.log("here");
document.addEventListener(pimcore.events.preMenuBuild, this.createNavigationEntry.bind(this));
} else {
document.addEventListener(pimcore.events.pimcoreReady, this.createNavigationEntry.bind(this));
Expand All @@ -32,6 +34,7 @@ pimcore.settings.perspectiveview = Class.create({
},

createNavigationEntry: function (e) {
console.log("hello");
const perspectiveCfg = pimcore.globalmanager.get('perspective');

if(!perspectiveCfg.inToolbar('settings.perspectiveEditor')){
Expand All @@ -54,7 +57,7 @@ pimcore.settings.perspectiveview = Class.create({

if(e.type === pimcore.events.pimcoreReady){
let menu = pimcore.globalmanager.get('layout_toolbar').settingsMenu;

console.log("hello");
menu.add(navigationItem);
}
}
Expand Down

0 comments on commit f916818

Please sign in to comment.