Closed Sonit90 closed 5 years ago
Ok, so module does work, if you prevent hash checking, in line 272 of NodeController and also if you update kartik-v/yii2-widget-activeform (v1.5.5 => v1.5.6): and manually create root element in database. After i created some elements, i can switch hash checking back, and it begin to work.
TreeSecurity::checkSignature('manage', $oldHash, $newHash);
**into**
**TreeSecurity::checkSignature('manage', $newHash, $newHash);**
I think, that problem persist, because hash is wrongly parsed, because in post data i see this:
treeManageHash=
'b9bb6105ca8787f27ec8346e572cfc8c4dcb8cc5cc5aaeb1f4ab60874915652aapp\\models\\Productbtn-default/treemanager/node/save/product/index@kvtree/views/_formw0-nodeselЭлементЭлементов<div class=\"kv-node-message\">Нет доступных для отображения. Используйте тулбар для добавлния новых </div>111111{\"id\":\"w0-nodeform\"}{\"1\":\"\",\"2\":\"\",\"3\":\"\",\"4\":\"\",\"5\":\"\"}{\"submit\":\"<i class=\\\"glyphicon glyphicon-floppy-disk\\\"></i>\",\"reset\":\"<i class=\\\"glyphicon glyphicon-repeat\\\"></i>\"}[]\"text\"{\"depth\":\"\",\"glue\":\" » \",\"activeCss\":\"kv-crumb-active\",\"untitled\":\"Без названия\"}'
EDITED You don't have to edit hash checking, just add root element to the table.
Check your oldHash data and newHash data - something is getting changed between the two (e,g. this typically could happen if you are using something like date time stamp). Preventing hashing is not a right solution. The solution is actually fix that issue and prevent data getting tampered by a rogue user.
Hi @kartik-v I am having the exact same issue. I have copie the manage action into my own controller and altered it a little bit to accomodate my need. Basically, I am trying to pass a DataProvider to nodeViewParams, which when I refresh the page, it works perfectly. I can see the GridView. The problem start when I change node, which give me that "Operation Disallowed" message. Without changing anything from the actual actionManage method, if I remove the dataProvider from the controller and also removing the GridView from the view, changing the node works again.
So that lead me to believe it is not something written in the actionManage method.
The thing is that I will have to add a new dataProvider inside the actionManage, as when the user click on a different node, I need to be able to show different data from different tables, but so far I can't even reach that point because I can't seems to be able to fix this initial issue.
I hope you can help, Alessandro
Prerequisites
Duplicate to https://github.com/kartik-v/yii2-tree-manager/issues/207
master
branch of yii2-tree-manager.Steps to reproduce the issue
Follow the steps from guide
Expected behavior and actual behavior
When I follow those steps, I was expecting extension to work properly, but i ecounter following errors: With version 1.0.8 i get this error:
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:
Btw, i had to add namespace app\controllers; to the controller.
Versions 1.0.8 and 1.0.9 doesn't work either.
Environment
Browsers
Operating System
Libraries
Isolating the problem