Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Bug in GT::SQL::File

Quote Reply
Bug in GT::SQL::File
There is a bug in GT/SQL/File.pm, around line 355 (and most probably also around line 337):
Code:
my $trec = $self->_file_getstats( $fname, $fdir, $col->{file_save_url}, ( -s $fh ) );
The correct code is somthing like:
Code:
my $trec = $self->_file_getstats( $fname, $fdir, $fcols{$col}->{file_save_url}, ( -s $fh ) );

This bug sets the 'File_URL' column in a xxx_File table to an empty string, when a file is modified.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Bug in GT::SQL::File In reply to
Already reported this. It was a major bugger with my Thumb_Images plugin, as when a user updated one of their images, it didn't update correctly...and the thumb wasn't correctly made Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
Thanks for the confirmation.

I am doing something similar (image gallery). The thumbnails are generated allright, it's just the File_URL field that is emptied when doing an update....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Bug in GT::SQL::File In reply to
Does your bug fix actually fix this? I may write the bug fix into my Install.pm file (making a backup of /GT/SQL/File.pm first)...and then replacing the buggy line, with the good line. As I said, this has been a major thorn in my side for a while. If this indeed fixes it...I'm very much in your debt Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
The fix I posted does fix the File_URL bug for me, you'll have to try if it fixes your bug...

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Bug in GT::SQL::File In reply to
Hi Ivan,

Thanks for the patch. I've committed it to CVS.

Cheers,
Aki
Quote Reply
Re: [Aki] Bug in GT::SQL::File In reply to
Which version you are communicating about? Is the bug in 2.12 also?
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] Bug in GT::SQL::File In reply to
Yup, its in 2.1.2. You need to make these changes manually, *or* wait until 2.1.3 (could be a while).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [cwschroeder] Bug in GT::SQL::File In reply to
Yes, I don't believe a product has been shipped yet with that bug fixed.

If you are using files and have code that makes use of the File_URL method, please update the file located at admin/GT/SQL/File.pm. By default, Links SQL does not use the File_URL so everything should be ok.
Quote Reply
Re: [Aki] Bug in GT::SQL::File In reply to
Maybe an official bug fix? Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
Good news Andy!

Yogi's bug fix does actually repair one problem we were having with the User Side Modifications. You may remember how your global "<%Plugins::Thumb_Images::ThumbFullURL($ID,sample1)%>" wasn't returning the complete file path upon modification from the User Side. I'm happy to say it's now returning the correct paths and I've tested it thoroughly. If you take a look at the DEV install we were working on you'll see I've removed the globals I was using to workaround this issue. So now those template are only using the Thumb_Images Globals. In a few minutes I'll PM you the URL to latest User Side Modifications I was playing with.

Unfortunatly the fix didn't help in creating the new thumbnails for User Side Modifications. Unsure

Is there any chance I can talk you into revisiting this issue and taking another stab at it? If Yogi has it working for his plug maybe he can offer some help or suggestions.

I'll send you a PM in a sec...

Thanks for the fix Yogi
Quote Reply
Re: [Jonze] Bug in GT::SQL::File In reply to
Yeah...I've been playing with it a little bit. The reason it won't work on the user side, is because I commented out the user modification hooks. I've fixed this on one of my clients installation, and am just waiting to see if it works ok for them, before I put it in the final release.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
Yup, the fix worked. Thanks Yogi. I've put a link to this thread with the fix, in my Readme. I was considering just making the install process make the fix to File.pm, but in the end I thought it would probably be safer if the site owner did it.

I'm uploading the fixed version in a second.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [yogi] Bug in GT::SQL::File In reply to
Was it both in line 337 and line 355 that we needed to correct this?
Bent
Quote Reply
Re: [bannerzone] Bug in GT::SQL::File In reply to
I only did it on 337, and that seems to fix the bug.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
changed:

$rec = $self->_file_getstats( $fname, $fdir, $col->{file_save_url}, ( -s $fh ) );
to:

my $trec = $self->_file_getstats( $fname, $fdir, $fcols{$col}->{file_save_url}, ( -s $fh ) );

????
Quote Reply
Re: [bannerzone] Bug in GT::SQL::File In reply to
Nooo... re-read the first post Wink It says to replace the line starting with $trec (gives the full line to you)... not $rec... as you will probably get a ISE now ;)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bug in GT::SQL::File In reply to
hehe, Uppppsssss BlushCrazy
I have changed the correct line now :-)

Thanks Andy !!!