kartik-v / yii2-tree-manager

An advanced tree management module using nested sets for Yii 2.
http://demos.krajee.com/tree-manager
Other
150 stars 107 forks source link

Operation Disallowed-Invalid request signature detected during tree data manage action #207

Closed ghost closed 5 years ago

ghost commented 5 years ago

I configured it according to the example, but I encountered this error,I don't know what to do with it

Operation Disallowed Invalid request signature detected during tree data manage action! Please refresh the page and retry.

OLD HASH: aa85180d79d2ede3c446bd3f210771c78c61e8b5ebd02012ada706b309bfb31acommon\models\Categorybtn-default/index.php?r=treemanager%2Fnode%2Fsave/index.php?r=category%2Findex@kvtree/views/_formw0-nodeselnodenodes No valid are available for display. Use toolbar buttons to add . 111111{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}{"submit":"","reset":""}[]["text"]{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"无标题"} NEW HASH: 6a97d361aa651e770afe7dde01010052a7dc1b8cf507fe66f53410abe47f1f6bcommon\models\Categorybtn-default/index.php?r=treemanager%2Fnode%2Fsave/index.php?r=category%2Findex@kvtree/views/_formw0-nodeselnodenodes111111{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}{"submit":"","reset":""}[]["text"]{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"无标题"}

kartik-v commented 5 years ago

Your data is showing up as tampered when being transferred between client JS and the server.

ghost commented 5 years ago

@kartik-v I used the most basic configuration,But the problem is the same.

composer.json { "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Project Template", "keywords": ["yii2", "framework", "advanced", "project template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.6", "yiisoft/yii2-bootstrap": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0", "kartik-v/yii2-tree-manager": "@dev" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", "yiisoft/yii2-gii": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0", "codeception/base": "^2.2.3", "codeception/verify": "~0.3.1" }, "config": { "process-timeout": 1800, "fxp-asset": { "enabled": false } }, "repositories": [ { "type": "composer", "url": "https://asset-packagist.org" } ] }

common\models\Cateogry <?php namespace common\models;

class Category extends \kartik\tree\models\Tree {

public static function tableName()
{
    return '{{%category}}';
}

}

backend\controllers\CategoryController <?php namespace backend\controllers;

use yii\web\Controller;

class CategoryController extends Controller { public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], ]; }

public function actionIndex()
{
    return $this->render('index');
}

}

@backend/views/category/index.php <?php use kartik\tree\TreeView; echo TreeView::widget([ // single query fetch to render the tree 'query' => \common\models\Category::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Categories'], 'isAdmin' => true, // optional (toggle to enable admin mode) 'displayValue' => 1, // initial display value //'softDelete' => true, // normally not needed to change //'cacheSettings' => ['enableCache' => true] // normally not needed to change ]);

ghost commented 5 years ago

@kartik-v I installed version 1.0.8 as normal. I don't know what caused it. Is there any new configuration in the new version?

ghost commented 5 years ago

@kartik-v I tried many times,Finding out how database records are empty raises questions. Found in Version 1.0.8 not have this problem.

kartik-v commented 5 years ago

No new configuration specifically - however you may want to review:

  1. check if you have caching issues on your browser (that maybe running stale outdated assets) - purge the yii2 web runtime assets and browser cache and restart/retry
  2. if you have done any customization / override of core extension class, views - cross check and reuse with the new code.
ghost commented 5 years ago

@kartik-v I tried many times,but there are problems. This is my code https://github.com/thinkwcz/tree-test

Sonit90 commented 5 years ago

@kartik-v I can confirm, that i encountered the same error, and versions 1.0.8 and 1.0.9 doesn't work either. I follower your instruction step by step, but it just doesn't work. With version 1.0.8 i get this error: Operation Disallowed Invalid request signature detected during tree data manage action! Please refresh the page and retry. OLD HASH:

NEW HASH: 8129b562eff233313c2aa8032073bcfe2c93b335ed83323fa2fab233c76ecb8eapp\models\Category1111/category/index@kvtree/views/_formw0-nodesel{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}"text"{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"Без названия"}

With version @dev i got this error: Operation Disallowed Invalid request signature detected during tree data manage action! Please refresh the page and retry. OLD HASH:

NEW HASH: 2c16c8eb0403c6d1026e6f0e146aa9a04a77e425832c3dda7cc93a03dbc06118app\models\Categorybtn-default/treemanager/node/save/category/index@kvtree/views/_formw0-nodeselЭлементЭлементов111111{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}{"submit":"","reset":""}[]"text"{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"Без названия"}

Using Chrome 69, cleared assets folder, reset the browser cache, nothing seems to work.

If i copy-pasted your example, then i got the next error:

OLD HASH: be6ce5ec1926bb360df5e149e3e1c8091038a2e69c6024f6ae964726fb868873app\models\Productbtn-default/treemanager/node/save/product/index@kvtree/views/_formw0-nodeselЭлементЭлементов Нет доступных для отображения. Используйте тулбар для добавлния новых 11111{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}{"submit":"","reset":""}[]"text"{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"Без названия"} NEW HASH: b651a9e37d3f6460173fb9636f7f8f99a43021cd1e98b9b933358cf272709203app\models\Productbtn-default/treemanager/node/save/product/index@kvtree/views/_formw0-nodeselЭлементЭлементов11111{"id":"w0-nodeform"}{"1":"","2":"","3":"","4":"","5":""}{"submit":"","reset":""}[]"text"{"depth":"","glue":" » ","activeCss":"kv-crumb-active","untitled":"Без названия"}

and btw, i had to add namespace app\controllers; to the controller

So it doesn't work at all.