yii2mod / yii2-cms

Simple CMS extension
MIT License
44 stars 23 forks source link

upload and delete image problem #21

Closed masihfathi closed 6 years ago

masihfathi commented 7 years ago

thanks for your work in the yii2 mod, currently when i want to upload or delete image i got this error: method not allowed

and user have admin permission but i got method not allowed error, thanks in advance for your answer.

masihfathi commented 6 years ago

this problem is still available

ihorchepurnyi commented 6 years ago

Hi, I changed the version of froala editor and created the release, update please your package.

masihfathi commented 6 years ago

the problem not solved when i want to upload image by editor i got "http://localhost:8080/en/cms/manage/upload-image 405 (Method Not Allowed)" in the console. and for deleting image i got "jquery.js:9175 GET http://localhost:8080/en/cms/manage/delete-image 405 (Method Not Allowed)". i add get request to behavior method of manageController of your extension and now when i upload image via editor and print_r model errors i got: Array ( [file] => Array ( [0] => Please upload a file. )

) {"link":"/files/attachment/0/0//origin."} in the console.

ihorchepurnyi commented 6 years ago

I can't reproduce this issue, I tried to reproduce this issue on yii 2.0.13, php 7.1, Mysql 5.7

ihorchepurnyi commented 6 years ago

Also, I used my template

masihfathi commented 6 years ago

thanks for your help, i test yii2 mod base template with fresh install and every things work properly, i think, finally found my problem, i used "https://github.com/codemix/yii2-localeurls" for multi language and upload and delete image dose not work with other language and works properly with default language.

masihfathi commented 6 years ago

For other people who are experiencing same problem, they can use the following configurations in the url manager to exclude ajax urls:

     'ignoreLanguageUrlPatterns' => [
             '#^cms/manage/(upload-image|delete-image|images)#' => '#^cms/manage/(upload-image|delete-image|images)#',
       ]