VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: gorbehnare on September 27, 2007, 19:07:01 PM

Title: [FIXED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: gorbehnare on September 27, 2007, 19:07:01 PM
I'm new to VM and I had nothing but problems with VM 1.0.12 on Joomla 1.5 RC2, couldn't even install it at all.
VirtueMart 1.1 revision 960 Complete Package installed perfectly with no problems what so ever! This is my first time seeing VM working ever so please bare with me since I don't know much about VM in the first place.
I am using VM with all Cart functionality disabled (plan to use it as a catalog only).

Description:
Two problems:
1. Front end user has to log in to view the shop (Error: You do not have permission to access the requested module)
With this it seems like a lot of people encounter this in many places. I have searched the forum and non of the solutions they have provided has worked for me so far. Seeing that many posts complaining about this means this is a normal behavior probably due to some combination of settings, but it will be nice if there was an easy way to fix this.

2. The thubnails are generated properly and are saved, however they do not show on the front end. (Image not found)
The image URL will be something like:
http://betatest.mhpcomputers.com/components/com_virtuemart/shop_image/product/resized/Athlon_64_3800+_46fb54bb518b6_90x90.jpg

This is what shows up in the front end for the image tag:
<img src="http://betatest.mhpcomputers.com/components/com_virtuemart/show_image_in_imgtag.php?filename=resized%2FAthlon_64_3800%2B_46fb54bb518b6_90x90.jpg&amp;newxsize=90&amp;newysize=90&amp;fileout=" alt="Athlon 64 3800+" border="0" height="90" width="90">

I generally get File does not exist and the image thumb will not show.

VirtueMart Version:
VirtueMart 1.1 revision 960 Complete Package

Joomla/Mambo Version:
Joomla! 1.5 RC2

Steps to replicate:
I have the Auto Genrate Thumbs enabled in configuration, and when I create the product I just upload the image (which is uploaded correctly) and check to automatically generate the Thumb (which generates currectly as well), and that's it...
Is there somthing I'm doing wrong? Am I missing something here?

System Info:
PHP Built on:       Linux cgi0802.int.bizland.net 2.6.19.2-grsec #1 SMP Mon Feb 5 18:45:14 EST 2007 i686
Database Version:    5.0.45-log
Database Collation:    utf8_general_ci
PHP Version:    5.2.1
Web Server:    Apache
Web Server to PHP interface:    cgi
Joomla! Version:    Joomla! 1.5.0 Production/Stable [ Endeleo ] 1-September-2007 15:00 GMT
User Agent:    Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20070717 SUSE/2.0.0.5-4.1 Firefox/2.0.0.5
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: gorbehnare on September 27, 2007, 19:39:48 PM
WORKAROUND:

The Dynamic Thumb Image resizing that can be set in admin configuration does not work. If you disable this option and ensure you always have the right thumb sizes then everything works.

So the bug is with the Dynamic Thumbnail Image Resizing Option

I still Haven't fixed that Permission error thou. Please help. It has got to do with one of these settings also...

No visitors can see the store at the time, but if you log in everything works. Any suggestions on where to begin looking for solutions please?
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: Scott Carroll on September 27, 2007, 20:11:31 PM
I've got the same issue here.
The thumbnail creation works, the thumbnail is displayed in product admin. It is just not showing up correctly through the store.
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: Scott Carroll on September 27, 2007, 20:21:05 PM
Got a solution.
In show_img_in_imgtag.php
at line 30:
// Image2Thumbnail - Klasse einbinden
include( CLASSPATH . 'ps_main.php');
include( CLASSPATH . "class.img2thumb.php");

$basefilename = @basename(urldecode($_REQUEST['filename']));
$filename = IMAGEPATH."product/".$basefilename;
$filename2 = IMAGEPATH."product/resized/".$basefilename;
$newxsize = @$_REQUEST['newxsize'];
$newysize = @$_REQUEST['newysize'];
$maxsize = false;
$bgred = 255;
$bggreen = 255;
$bgblue = 255;


both CLASSPATH and IMAGEPATH need to be relative to document root, not site root.
I added:

// Image2Thumbnail - Klasse einbinden
include( "/home/yournamehere/public_html" . CLASSPATH . 'ps_main.php');
include( "/home/yournamehere/public_html" . CLASSPATH . "class.img2thumb.php");

$basefilename = @basename(urldecode($_REQUEST['filename']));
$filename = "/home/yournamehere/public_html" . IMAGEPATH."product/".$basefilename;
$filename2 = "/home/yournamehere/public_html" . IMAGEPATH."product/resized/".$basefilename;
$newxsize = @$_REQUEST['newxsize'];
$newysize = @$_REQUEST['newysize'];
$maxsize = false;
$bgred = 255;
$bggreen = 255;
$bgblue = 255;


And now it works. Not pretty, but it returns functionality. The goal here would be to change the global declaration of these variables to be document root instead of site root.
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: Scott Carroll on September 27, 2007, 20:37:59 PM
Nevermind all that, I got a fix here for ya'

in /configuration.php

/* Site Settings */
var $offline = '0';
var $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
var $sitename = 'Your Site Name';
var $editor = 'tinymce';
var $list_limit = '20';
var $legacy = '0';


Change it to add
var $absolute_path = '/your/path/here';
var $live_site = '';
So it looks like:

/* Site Settings */
var $offline = '0';
var $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
var $sitename = 'Your Site Name';
var $editor = 'tinymce';
var $list_limit = '20';
var $legacy = '0';
var $absolute_path = '/your/path/here';
var $live_site = '';


Of course, change /your/path/here to your document root path.
And that fixes the issue, and doesn't seem to cause any other ruckus.
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: gorbehnare on September 27, 2007, 21:32:45 PM
Thanks for the fix...  ;)  now I got to remember I have a customized configure.php file on joomla! 1.5 when I update stuff  :D
Title: Re: VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: aravot on September 27, 2007, 23:10:22 PM
Quote from: gorbehnare on September 27, 2007, 19:07:01 PM
Two problems:
1. Front end user has to log in to view the shop (Error: You do not have permission to access the requested module)
With this it seems like a lot of people encounter this in many places. I have searched the forum and non of the solutions they have provided has worked for me so far. Seeing that many posts complaining about this means this is a normal behavior probably due to some combination of settings, but it will be nice if there was an easy way to fix this.

Can not replicate.

Quote2. The thubnails are generated properly and are saved, however they do not show on the front end. (Image not found)
The image URL will be something like:
http://betatest.mhpcomputers.com/components/com_virtuemart/shop_image/product/resized/Athlon_64_3800+_46fb54bb518b6_90x90.jpg

Confirmed using Joomla 1.5 r9007 (this must have happened either in latest revision of Joomla or VM cause it was working before)
It works OK in Joomla 1.0.13
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: gregdev on September 27, 2007, 23:11:27 PM
Regarding the second problem:

I don't recommend editing Joomla's configuration file. VirtueMart needs to be self-contained.

The difficulty here is that show_img_in_imgtag.php is called directly. None of the Joomla! 1.5 framework is loaded. If it were loaded (with the legacy plugin enabled), then the variables we need would be there. As you noticed, only $mosConfig_absolute_path is needed.

You could load the Joomla! 1.5 framework. We do that inside notify.php. But, in that case, we need all of that overhead. But here, we want things to be lightweight.

How about something like this?

define('_VALID_MOS', 1);

// Get the Joomla! configuration file
$config_file = '../../configuration.php';
include_once( $config_file );

if( !isset( $mosConfig_absolute_path ) ) {
// We are in J! 1.5
define( '_JEXEC', 1 );
$mosConfig_absolute_path = dirname( $config_file );
}

include_once("../../administrator/components/com_virtuemart/virtuemart.cfg.php");



Although I don't like using ../.. , it is already being used. Oh well.

What do you think?

Greg

Edit: Just to clarify... The define( '_JEXEC', 1 ); is not necessary now. But it may be needed in the future as we improve compatibility with J! 1.5.
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: Scott Carroll on September 27, 2007, 23:45:07 PM
It is working. Good call, although I can't help but feel that there is a cleaner way to do this still. This does work to keep it self contained.
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: aravot on September 28, 2007, 02:28:06 AM
Greg tried SVN 961 (new image compatibility file), still the same can't see images in Joomla 1.5 r9030 and VM 1.1 r961
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: gregdev on September 28, 2007, 03:07:30 AM
Interesting. It works for me on VM 1.1 r961 and Joomla! 1.5 r9059.

Which browser(s)?

Try opening one of those image URLs directly into a new browser window (same session, though). What happens?

Greg
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: aravot on September 28, 2007, 03:21:50 AM
Let me update my Joomla 1.5 and start from fresh.
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: gorbehnare on September 28, 2007, 05:48:04 AM
How about we just add the server path to the VM settings in the configurations. There is the path for the secure server, why not include the normal one too. The installer should detect that (hopefully) automatically, but there is no harm in user being able to modify the path manually. Right now I'm experiencing more Path related issues with my new installation... there is a slash missing this time. please refer to this post:
http://forum.virtuemart.net/index.php?topic=32238.0 (http://forum.virtuemart.net/index.php?topic=32238.0)
Title: Re: [CONFIRMED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front e
Post by: aravot on September 29, 2007, 20:43:05 PM
Tried with fresh install of Joomla 1.5 r9077 and VM 1.1 r962, FIXED.
Title: Re: [FIXED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: VMit on October 08, 2007, 16:28:43 PM
Same bug with VirtueMart 1.0.12 stable & Joomla 1.11 Patch 03 (UTF-8).

QuoteI'm new to VM and I had nothing but problems with VM 1.0.12

VirtueMart  1.0.12 stable installed perfectly with no problems.

I inserted some products in VM and it forked just fine - big & small pics show up.

But after some time i installed  more products and find out that small pics dont show up and in another installation width and height of picture in separate window set to "" (empty).
I other installation I turned resizing in Configuration to ON and the values become 9 instead of 90. I will find out. And try to apply the fix here to my sites.

BTW there is another bug with resizing is fixed in class.img2thumb.php which in russian forum in a file class.img2thumb(v.1.5.2.1_duch_edition).zip.

Title: Re: [FIXED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: Cam.G on March 31, 2009, 05:40:53 AM
Hi all,

Does anybody have any idea where extra root information could be kept in relation to extra images?  Hovering over the thumbnails of my secondary images on the flypage shows that they are trying to load from the old server root, not the new one as updated in the VM security settings panel.

Local test server / Joomla! 1.5.9 / Virtuemart 1.1.3 Stable

Cheers,
Cam
Title: Re: [FIXED] VM 1.1 on Joomla! 1.5 RC2: Picture Thumbs not showing on front end
Post by: Cam.G on March 31, 2009, 08:20:01 AM
Solved.  The Issue was that the pathway in the Database doesn't update... which seems a bit silly really.  You can see the solution here: https://forum.virtuemart.net/index.php?topic=37353.msg116167#msg116167

Cheers,
Cam