yii2-images icon indicating copy to clipboard operation
yii2-images copied to clipboard

После обновления getUrl создает странную ссылку

Open alex290 opened this issue 7 years ago • 8 comments

После обновления getUrl создает странную ссылку в итоге ссылка несуществует Например /5/images/image-by-item-and-alias?item=Slider1&dirtyAlias=16a1585d57-1_2048x490.jpg

Я так понимаю первая цифра это id материала

А вот getPath работает нормально

alex290 avatar Nov 22 '17 09:11 alex290

На текущем комите (ac4e15f2fdd01019c3c2edd2ba90e71138370dc3) не работает. Проблема осталась

vavilin avatar Dec 24 '17 11:12 vavilin

I have the same issue - it doesn't work for me on current mainline with Yii2 v. 2.0.13.1. It generates invalid image url request to which fails with 404. Url sample: /114/images/image-by-item-and-alias?item=Advert4690180565777482888&dirtyAlias=9947f6d2ab-1.jpg

ygrigoriev avatar Jan 17 '18 12:01 ygrigoriev

I think here was broken module behavior. I added to urlManager rule '<id:([0-9])+>/images/image-by-item-and-alias' => 'yii2images/images/image-by-item-and-alias' and it seems to be working... But I'm not sure this is a good approach. P.S. I think changes like this must be marked in documentation!

zeyser avatar Jan 21 '18 14:01 zeyser

Hello, i have a seem problem like /2/images/image-by-item-and-alias?item=Product4&dirtyAlias=368da602e2-1.png , how to fix this? I very need it, help please

TreeHouse98 avatar Mar 07 '18 18:03 TreeHouse98

Same problem :( quick fix is to change '/'.$this->getPrimaryKey().'/images/image-by-item-and-alias', to '/yii2images/images/image-by-item-and-alias', or back to '/'.$this->getModule()->id.'/images/image-by-item-and-alias', in vendor\costa-rico\yii2-images\models\Image.php

dpotekhin avatar May 24 '18 12:05 dpotekhin

Same problem with getUrl (). Let's finally do this shit.

artmarkov avatar Jul 02 '18 17:07 artmarkov

Same problem :( quick fix is to change '/'.$this->getPrimaryKey().'/images/image-by-item-and-alias', to '/yii2images/images/image-by-item-and-alias', or back to '/'.$this->getModule()->id.'/images/image-by-item-and-alias', in vendor\costa-rico\yii2-images\models\Image.php

Thanks you. Helped to fix this problem.

AndreyTSpb avatar Jan 14 '19 13:01 AndreyTSpb

Получается только vendor\costa-rico\yii2-images\models\Image.php нужно править '/'.$this->getPrimaryKey().'/images/image-by-item-and-alias', меняем на '/'.$this->getModule()->id.'/images/image-by-item-and-alias', но для yii advanced приходится для вывода все же использовать filePath

ashifin72 avatar Oct 21 '19 14:10 ashifin72