Gossamer Forum
Home : Products : Gossamer Links : Discussions :

bug when submitting with image?

Quote Reply
bug when submitting with image?
After much investigation I think I have discovered a bug. Well I discovered and change in glinksql anyway that is causing me problems.

Basically, if I submit information via a a button like this:
<input type=image name=add value="1" src=/images/mybutton.gif width="50" height="50" border="0" />

What actually gets submitted are these values:
add = 1
add.x = 50
add.y = 50

The last two values are the dimensions of the image being clicked on. (internet exploder doesn't pass in the add=1 value at all, only the dimension values .x and .y.

Now that in and of itself doesn't cause any problems, but if on the receiving page you run a global like this:
sub {
my ($rec) = GT::Template->tags or
my ($rec) = @_;

do some stuff and
return $rec;
}

You will get the following error.
Not a HASH reference at GT::Template line xxx

The problem is being caused by the add.y and add.x values.

This was not a problem in previous versions.

Any suggestions?

peace.

klangan
Quote Reply
Re: [klangan] bug when submitting with image? In reply to
Which line is it dying on, and which versions of glinks did it work on?

Adrian
Quote Reply
Re: [brewt] bug when submitting with image? In reply to
Hi Adrian,

Line 900 and v. 3.2

I was able to reproduce this error on a different installation as described above.

peace.

klangan
Quote Reply
Re: [brewt] bug when submitting with image? In reply to
Hi Adrian,

It was working without a problem on v 2.1

peace.
klangan
Quote Reply
Re: [klangan] bug when submitting with image? In reply to
Can you give me access to your admin panel and detailed instructions on how to get it to fail?

I tried reproducing the problem and couldn't do it.

PS: GT::Template->tags has been deprecated in favour of GT::Template->vars.

Adrian
Quote Reply
Re: [brewt] bug when submitting with image? In reply to
I've committed a fix so that it won't die in the future, but you probably shouldn't be getting vars and then returning it since you'll make GT::Template do a lot of unnecessary work. Instead, just return a hash of key/values of the specific things you want updated.

Adrian