yii-starter-kit / yii2-starter-kit

Yii2 Starter Kit
http://yii2-starter-kit.terentev.net
Other
1.41k stars 646 forks source link

Problem with upload widget #667

Closed nikosid closed 5 years ago

nikosid commented 5 years ago

You can upload only 2 files. If you choise more than 2 then only 2 will be saved.

In browser you can see that first element has index 0, second has 1 and others also have index 1.

So we save only first(with index 0) and the last(last with index 1). I mean this index Article[attachments][1][path] in <input name="Article[attachments][1][path]" value="/1/SdiMqdCRQMOR8Svh45e6en7JGpZJAFjA.jpg" type="hidden">

It seems like the reason is in yii2-starter-kit/yii2-file-kit/src/widget/assets/js/upload-kit.js:methods.getNewItemIndex but I didn't get what the problem yet.

You can see this problem in your demo http://backend.yii2-starter-kit.terentev.net/content/article/update?id=1

nikosid commented 5 years ago

I see you already have the issue here https://github.com/yii2-starter-kit/yii2-file-kit/issues/146