yireo / Yireo_NextGenImages

44 stars 26 forks source link

NotFoundException Wrong parameters #10

Closed Quazz closed 3 years ago

Quazz commented 3 years ago

Wrong parameters are passed to NotFoundException.

It expects a string, but receives a Phrase object

https://github.com/yireo/Yireo_NextGenImages/blob/master/Image/UrlConvertor.php#L77

and

https://github.com/yireo/Yireo_NextGenImages/blob/master/Image/UrlConvertor.php#L92

Easy enough to fix by appending ->__toString() at the end of the Phrase object.

jissereitsma commented 3 years ago

Hmm, \Magento\Framework\Phrase::__toString() is actually a magic method which should be called whenever it is casted to a string. I'd rather cast it to a string, instead of calling the magic method manually (which is actually a less recommended action - you are also not calling upon __construct, __call, __get and __set manually).

Will fix this and release right away.

jissereitsma commented 3 years ago

Fixed in 0.2.6 https://github.com/yireo/Yireo_NextGenImages/blob/master/Image/UrlConvertor.php#L77