From cb5403c00fe9423a17a4fb6a663155774e4e62b3 Mon Sep 17 00:00:00 2001 From: Sytorex <68004414+Sytorex-pro@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:42:41 +0100 Subject: [PATCH] improv. convert social request to new method (#302) --- app/Controller/SocialController.php | 2 +- app/View/Social/admin_index.ctp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Controller/SocialController.php b/app/Controller/SocialController.php index eae0c340..c65ce1d8 100644 --- a/app/Controller/SocialController.php +++ b/app/Controller/SocialController.php @@ -26,7 +26,7 @@ public function admin_save_ajax() { if ($this->isConnected AND $this->Permissions->can('MANAGE_SOCIAL')) { if ($this->request->is('post')) { if (!empty($this->request->data)) { - $data = $this->request->data['xss']['social_button_order']; + $data = $this->request->data['social_button_order']; $data = explode('&', $data); $i = 1; foreach ($data as $key => $value) { diff --git a/app/View/Social/admin_index.ctp b/app/View/Social/admin_index.ctp index 78edc401..81d79635 100644 --- a/app/View/Social/admin_index.ctp +++ b/app/View/Social/admin_index.ctp @@ -61,10 +61,8 @@ items: '.item:not(.fixed)', stop: function (event, ui) { $('#save').empty().html('get('SOCIAL__SAVE_IN_PROGRESS') ?>'); - var inputs = {}; - var social_button_order = $(this).sortable('serialize'); - inputs['social_button_order'] = social_button_order; - $('#social_button_order').text(social_button_order); + let inputs = {}; + inputs['social_button_order'] = $(this).sortable('serialize'); inputs['data[_Token][key]'] = ''; $.post("Html->url(array('controller' => 'social', 'action' => 'save_ajax', 'admin' => true)) ?>", inputs, function(data) { if(data.statut) { @@ -79,3 +77,4 @@ }); }); +