VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: gba on November 16, 2015, 22:43:01 PM

Title: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: gba on November 16, 2015, 22:43:01 PM
Hello VM community!

I noticed, that after updating from v3.0.12, Revision 9028, the 'Used thumb url' field in product images is empty.
Can anyone confirm this behavior?

'Reset Thumbs' does not work, either, just giving a notice with content:
1

Tried it on several webservers - always the same.

I'm looking forward to your response!

Kind regards,
Gerald
Title: Re: 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on November 16, 2015, 22:52:45 PM
correct .. as there is the possibility of multiple thumbs the 'Used thumb url' field is no longer filled
and is emptied if you Reset Thumbs

http://docs.virtuemart.net/tutorials/templating-layouts/222-different-thumbnail-sizes.html

thumb can normally be returned with  I think $product->images[0]->FileUrlThumb();
Title: Re: 'Used thumb url' empty after update to 3.0.12
Post by: gba on November 16, 2015, 22:56:12 PM
Hi!

Thank you very much for that information.
Wow - great feature!
Good job VM team!  8)

Best regards,
Gerald
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on November 16, 2015, 22:59:39 PM
the laugh is that Max reckons it has always "been there"..  just that it was never really doc'd or might have needed polishing...
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: gba on November 16, 2015, 23:05:14 PM
 ::)
Was just shocked, why $product->images[0]->file_url_thumb suddenly did not work anymore  ;)
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on November 16, 2015, 23:08:50 PM
yes.. there's been quite a bit of template and extension rewriting in some cases..  was very popular in cart mods etc
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: kareensa on November 24, 2015, 22:50:26 PM
Hello.
I have lost all thumbs. Haw can i return it. All thumbs field a clearn:
http://www.papa-zoo.ru/katalog/koshki
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: Milbo on November 25, 2015, 10:47:22 AM
Quote from: GJC Web Design on November 16, 2015, 22:52:45 PM
correct .. as there is the possibility of multiple thumbs the 'Used thumb url' field is no longer filled
and is emptied if you Reset Thumbs

http://docs.virtuemart.net/tutorials/templating-layouts/222-different-thumbnail-sizes.html

thumb can normally be returned with  I think $product->images[0]->FileUrlThumb();
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: kareensa on November 25, 2015, 12:47:10 PM
thx, but im not programmer.  Explain please more detail :-[
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: CE WebDesign München on November 25, 2015, 16:59:08 PM
hi,

I'm not using "Enable Dynamic Thumbnail Resizing"

after upgrade vm2 to vm3.0.12 when saving an existing product the 'Used thumb url' of the first image is changed to "image_90x90.jpg"
how can I prevent this?
or do all thumbs have to be renamed in form of "image_90x90.jpg"?

Best regards, chris
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: olejenya on December 10, 2015, 07:48:54 AM
$product->images[0]->file_url_thumb;

does not work <images src="<?php echo $base(road).$product->images[0]->FileUrlThumb();" />

Is it possible to then work with this  $image->displayMediaThumb('u="thumb"',false,'') ?? to make such a structure in the code:

<images data-src="<?php echo $base(road).$product->images[0]->file_url_thumb;" src="<?php echo $base(road).'/images/loading.gif'" /> for scripts
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on December 10, 2015, 10:47:34 AM
what's the $base(road) bit for?

$product->images[0]->FileUrlThumb();  is a function call to the $product object and returns a url
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: olejenya on December 10, 2015, 10:58:12 AM
Quote from: GJC Web Design on December 10, 2015, 10:47:34 AM
what's the $base(road) bit for?

$product->images[0]->FileUrlThumb();  is a function call to the $product object and returns a url
$base  = 'www.testr.com/' - This example
$product->images[0]->FileUrlThumb();  - I understand, but why it does not work and an error that does not have access to it, how to connect properly? May need to add some code something that would function work?
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on December 10, 2015, 11:02:23 AM
depends where you use it..

could be e.g. $this->product on the details page
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: olejenya on December 10, 2015, 16:00:25 PM
Quote from: GJC Web Design on December 10, 2015, 11:02:23 AM
depends where you use it..

could be e.g. $this->product on the details page


does not work
where to see a working example?
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: olejenya on December 11, 2015, 07:33:21 AM
$product->images[0]->getFileUrlThumb();
$this->product->images[0]->getFileUrlThumb();

Here are examples of workers who are interested
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: davidex2 on January 13, 2016, 17:39:07 PM
Hello to all. These are days that I try to figure out how to fix this problem, but I just can not.

Someone could be more specific and explain step by step what you must do?

If I upgrade to 3.0.12 lose all thumbnails

Thank you all.
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on January 13, 2016, 22:37:26 PM
it depends on your template and often in things like 3rd party image zoom ext., 3rd party carts with thumbs, or additional thumbs in details etc

where they have a image url like below which simply got a databased stored url (which isn't stored now)

$thumb = $product->images[0]->file_url_thumb;

etc

you need to replace with the function

$thumb = $product->images[0]->getFileUrlThumb();
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: Doomas on January 14, 2016, 13:34:45 PM
Is it possible that

$product->images[0]->getFileUrlThumb()

does not creat the thumbnail file?

I hade the case that today a customer reseted all thumbnails. And they wehre not automatically recreated. I had to insert follwing line to auto create the tumbs:

$product->images[0]->displayMediaThumb('',false);

Is this an intendet behavior or a bug?
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: jenkinhill on January 14, 2016, 16:21:34 PM
Maybe someone turned off "Enable Dynamic Thumbnail Resizing"
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: Doomas on January 14, 2016, 17:17:19 PM
No, this was also my first thought.

I took a quick look at the  code of getFileUrlThumb() and displayMediaThumb(). If I've not missed somthing creatThumb() is not called anyware inside getFileUrlThumb(). So you have to use dispalyMediaThumb() to make sure any missings thumbnails will be created. 
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: olejenya on January 20, 2016, 21:12:18 PM
How use $images = $manufacturer->images[0]->file_url_thumb;
do not works  $manufacturer->images[0]->getFileUrlThumb();
Another function is used for brands?What?
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: userakos on January 22, 2016, 13:03:48 PM
I have the same problem since I upgraded to 3.0.12.
The first thumbnail is created. The next thumbnails (in the same product) are not created in the resized folder.

What a mess...
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: jenkinhill on January 22, 2016, 15:05:49 PM
No problem creating additional thumbs here, except that they don't display correctly on the product images page until the product is closed & saved.  They appear in the resized folder OK.
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: stAn99 on March 14, 2016, 20:55:29 PM
for the backward compatibility of extensions which do not use virtuemart functions, but rely on virtuemart objects such as the media object, i would suggest to modify:

\administrator\components\com_virtuemart\models\media.php

update whole function to this:

public function attachImages($objects,$type,$mime='',$limit=0){
if(!empty($objects)){
if(!is_array($objects)) $objects = array($objects);
foreach($objects as $k => $object){
if(!is_object($object)){
$object = $this->createVoidMedia($type,$mime);
}

if(empty($object->virtuemart_media_id)) $virtuemart_media_id = null; else $virtuemart_media_id = $object->virtuemart_media_id;
$object->images = $this->createMediaByIds($virtuemart_media_id,$type,$mime,$limit);

foreach ($object->images as &$image)
{
if (empty($image->file_url_thumb)) {
  $image->file_url_thumb = $image->getFileUrlThumb();
}
}
//This should not be used in fact. It is for legacy reasons there.
if(isset($object->images[0]->file_url_thumb)){
$object->file_url_thumb = $object->images[0]->file_url_thumb;
$object->file_url = $object->images[0]->file_url;
}
}
}
}



the main reason is that some extensions still rely on this variable:

$YagImage->urlThumb = JUri::base() . $vmImage->file_url_thumb;   

yagendoo template's
\plugins\system\yagendoo_system_plugin\src\framework_v1\ecm\libs\yag_helper\helper.image_mapper.php

and many others.

so instead of forcing to use a VM function it would be nice if VM would include this variable in a way that would be backward compatible.

best regards, stan, rupostel.com
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: Milbo on March 14, 2016, 21:54:25 PM
Quote from: Doomas on January 14, 2016, 17:17:19 PM
So you have to use dispalyMediaThumb() to make sure any missings thumbnails will be created. 

The intended way to use the vm media system. It was always wrong, that people used the file_url_thumb. The file_url_thumb is dynamic and can be different by size. The functions displayMediaFull() and displayMediaThumb() are the intended functions since vm2.0.0
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: Thomas Kuschel on April 19, 2016, 16:28:11 PM
@stAn99. you saved my day, thanks.
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: minista on May 16, 2016, 19:31:50 PM
I changed this code here:

// Output: Product Image
if ($product->images && $show['show_product_image'] == 'yes') {

$html.=     '<div class="product-thumbnail">';
$html.=         '<a href="'.$productLink.'" title="'.$product->product_name.'">';
$html.=             '<img src="'.JRoute::_($product->images[0]->file_url_thumb).'" itemprop="image" class="product-image" title="'.$product->product_name.'" alt="'.$product->product_name.'" />';
$html.=         '</a>';
$html.=     '</div>';

}


to this but nothing changed.... What am i doing wrong?

// Output: Product Image
if ($product->images && $show['show_product_image'] == 'yes') {

$html.=     '<div class="product-thumbnail">';
$html.=         '<a href="'.$productLink.'" title="'.$product->product_name.'">';
$html.=             '<img src="'.JRoute::_($product->images[0]->FileUrlThumb).'" itemprop="image" class="product-image" title="'.$product->product_name.'" alt="'.$product->product_name.'" />';
$html.=         '</a>';
$html.=     '</div>';

}
Title: Re: [solved] 'Used thumb url' empty after update to 3.0.12
Post by: GJC Web Design on May 16, 2016, 21:31:40 PM
where did u get that from?

should be

$product->images[0]->getFileUrlThumb()