{"action":"created","issue":{"url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/738","repository_url":"https://api.github.com/repos/kartik-v/yii2-grid","labels_url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/738/labels{/name}","comments_url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/738/comments","events_url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/738/events","html_url":"https://github.com/kartik-v/yii2-grid/issues/738","id":282576639,"number":738,"title":"After update to yii 2.0.13, default delete ActionColumn has not expected behaviour ","user":{"login":"baldiri","id":10255019,"avatar_url":"https://avatars1.githubusercontent.com/u/10255019?v=4","gravatar_id":"","url":"https://api.github.com/users/baldiri","html_url":"https://github.com/baldiri","followers_url":"https://api.github.com/users/baldiri/followers","following_url":"https://api.github.com/users/baldiri/following{/other_user}","gists_url":"https://api.github.com/users/baldiri/gists{/gist_id}","starred_url":"https://api.github.com/users/baldiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldiri/subscriptions","organizations_url":"https://api.github.com/users/baldiri/orgs","repos_url":"https://api.github.com/users/baldiri/repos","events_url":"https://api.github.com/users/baldiri/events{/privacy}","received_events_url":"https://api.github.com/users/baldiri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-12-15T23:38:09Z","updated_at":"2017-12-17T20:15:19Z","closed_at":"2017-12-16T05:06:02Z","author_association":"NONE","body":"Hi, \r\n\r\nlet me first thanks to you for sharing your wonderful job. Now my question, even i thing that it's not related to your extension (i think so) maybe i can get some clue about this.\r\n\r\nUntil 2.0.12 yii2 framework version i've been using you fantastic grid with pjax active and your ActionColumn class for deleting (your default delete, not overwritten), and everything is ok, so row is deleted and grid reloads (not whole page), page of grid is maintained, filters...\r\n\r\nFrom 2.0.13 same code behaves differently. In fact page reload and i get a blank page with json response (which is not used, you'll see at code).\r\n\r\nThe only diference is yii2 version. I know that yii 2.0.13 integrates new version of jquery 3.2.1 and as well i use yii2-jui newer as well.\r\n\r\ncontroller (delete action):\r\n\r\npublic function actionDelete($id)\r\n    {\r\n        $model = $this->findModel($id);\r\n        $model->deleted = 1;\r\n\r\n        ProductAccessories::deleteAll(['id_accessory' => $id]);\r\n        SubcategoryAccessories::deleteAll(['id_accessory' => $id]);\r\n\r\n        Yii::$app->response->format = Response::FORMAT_JSON;\r\n\r\n        if ($model->save()) {\r\n            return [\r\n                'message' => Yii::t('app', '¡Operación realizada con éxito!'),\r\n                'status' => 2,\r\n            ];\r\n        } else {\r\n            return [\r\n                'message' => Yii::t('app', '¡Error en la operación!'),\r\n                'status' => 0,\r\n            ];\r\n        }\r\n    }\r\n\r\nview (ActionColumn):\r\n\r\n[\r\n                'class' => 'kartik\\grid\\ActionColumn',\r\n                'width' => '100px',\r\n                'vAlign' => 'left',\r\n                'dropdown' => true,\r\n                'template' => '{update} {delete}',\r\n                'dropdownOptions' => ['class' => 'pull-right'],\r\n                'dropdownButton' => ['label' => Yii::t('app', 'Accions'), 'class'=>'btn btn-default'],\r\n                'updateOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-pencil\"></span> ' . Yii::t('app', 'Editar'),\r\n                ],\r\n                'deleteOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-trash\"></span> ' . Yii::t('app', 'Eliminar'),\r\n                ],\r\n],\r\n\r\nAs i say, same code works as expected with yii 2.0.12 and not with yii 2.0.13.  Any ideas about? i need a clue from somebody...\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/comments/352282085","html_url":"https://github.com/kartik-v/yii2-grid/issues/738#issuecomment-352282085","issue_url":"https://api.github.com/repos/kartik-v/yii2-grid/issues/738","id":352282085,"user":{"login":"baldiri","id":10255019,"avatar_url":"https://avatars1.githubusercontent.com/u/10255019?v=4","gravatar_id":"","url":"https://api.github.com/users/baldiri","html_url":"https://github.com/baldiri","followers_url":"https://api.github.com/users/baldiri/followers","following_url":"https://api.github.com/users/baldiri/following{/other_user}","gists_url":"https://api.github.com/users/baldiri/gists{/gist_id}","starred_url":"https://api.github.com/users/baldiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldiri/subscriptions","organizations_url":"https://api.github.com/users/baldiri/orgs","repos_url":"https://api.github.com/users/baldiri/repos","events_url":"https://api.github.com/users/baldiri/events{/privacy}","received_events_url":"https://api.github.com/users/baldiri/received_events","type":"User","site_admin":false},"created_at":"2017-12-17T20:15:19Z","updated_at":"2017-12-17T20:15:19Z","author_association":"NONE","body":"Hi @kartik-v \r\n\r\ni did some test with different versions of your extension and this what happens:\r\n\r\nsame controller action for all versions of your extension (3.1.5, 3.1.6, 3.1.7 and dev-master):\r\n\r\npublic function actionDelete($id)\r\n{\r\n        $model = $this->findModel($id);\r\n        $model->deleted = 1;\r\n        $model->save();\r\n        return null;\r\n}\r\n\r\nview (actionColumn with your extension 3.1.5 version):\r\n[\r\n                'class' => 'kartik\\grid\\ActionColumn',\r\n                'width' => '100px',\r\n                'vAlign' => 'left',\r\n                'dropdown' => true,\r\n                'template' => '{update} {delete}',\r\n                'dropdownOptions' => ['class' => 'pull-right pull-over'],\r\n                'dropdownButton' => ['label' => Yii::t('app', 'Accions'), 'class'=>'btn btn-default'],\r\n                'updateOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-pencil\"></span> ' . Yii::t('app', 'Editar'),\r\n                ],\r\n                'deleteOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-trash\"></span> ' . Yii::t('app', 'Eliminar'),\r\n                ],\r\n],\r\n\r\nWorks ok, so i get pjax delete maintaining page and filters in grid. Works as expected\r\n\r\nview (actionColumn with your extension 3.1.6 or 3.1.7 or dev-master):\r\n[\r\n                'class' => 'kartik\\grid\\ActionColumn',\r\n                'width' => '100px',\r\n                'vAlign' => 'left',\r\n                'dropdown' => true,\r\n                'template' => '{update} {delete}',\r\n                'dropdownOptions' => ['class' => 'pull-right pull-over'],\r\n                'dropdownButton' => ['label' => Yii::t('app', 'Accions'), 'class'=>'btn btn-default'],\r\n                'updateOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-pencil\"></span> ' . Yii::t('app', 'Editar'),\r\n                ],\r\n                'deleteOptions' => [\r\n                    'label' => '<span class=\"glyphicon glyphicon-trash\"></span> ' . Yii::t('app', 'Eliminar'),\r\n                    'data-pjax' => true,\r\n                    'data-method' => 'POST',\r\n                ],\r\n],\r\n\r\nIn this case (from your 3.1.6 included till dev-master), i get  \"Method Not Allowed (#405)\" as i tell you before. yii-debug extension show that 2 request are done ¿?¿. \r\n\r\nLast wich generates \"Method Not Allowed (#405)\":\r\n5a36ce05960a8: GET http://localhost/users/delete?id=39 at 2017-12-17 09:05:25 pm by 192.168.3.1\r\n\r\nPrevious and correct (through your delete pjax) at same moment:\r\n5a36ce0556b24: POST http://localhost/users/delete?id=39 (AJAX) at 2017-12-17 09:05:25 pm by 192.168.3.1\r\n\r\nSo now after this simple text i think your extension must have some wrong thing from 3.1.6 included or later versions, we'll i'm not sure but i can't find another explanation.\r\n\r\nThanks a lot in advance!\r\n"}}
{"actor":{"display_login":"baldiri"}}