Last Comment Bug 576524 - Could not upload images
: Could not upload images
Status: UNCONFIRMED
:
Product: Testopia
Classification: Server Software
Component: General (show other bugs)
: unspecified
: x86 Windows XP
: -- normal with 2 votes (vote)
: ---
Assigned To: Greg Hendricks
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-02 08:09 PDT by Andreas Höhmann
Modified: 2012-11-06 08:01 PST (History)
2 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
bugfix to insert BLOB data into attachment_data table (22.38 KB, application/octet-stream)
2010-08-16 05:18 PDT, Thomas Wabner
no flags Details
patch for Attachment.pm with diff -u option between trunk and 2.2 Version (6.99 KB, patch)
2010-09-10 08:50 PDT, Thomas Wabner
no flags Details | Diff | Splinter Review

Description Andreas Höhmann 2010-07-02 08:09:27 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)
Build Identifier: 

File upload result in 

<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR:  invalid byte sequence for encoding &quot;UTF8&quot;: 0xff
HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by &quot;client_encoding&quot;. [for Statement &quot;INSERT INTO test_attachment_data (attachment_id, contents) VALUES(?,?)&quot;] at Bugzilla/Testopia/Attachment.pm line 183
	Bugzilla::Testopia::Attachment::create('Bugzilla::Testopia::Attachment', 'HASH(0x3241ac0)') called at /var/www/domains/bugzilla.stoneball.com/htdocs/tr_attachment.cgi line 152
</pre>
<p>
For help, please send mail to the webmaster (<a href="mailto:[no address given]">[no address given]</a>), giving this error message 
and the time and date of the error.

</p>

Reproducible: Always

Steps to Reproduce:
1. open testcase
2. switch tab "attachments"
3. try to upload a file
Comment 1 Thomas Wabner 2010-08-16 05:18:37 PDT
Created attachment 466285 [details]
bugfix to insert BLOB data into attachment_data table

I have fixed the database statement below line 182 in the Attachment.pm to allow testopia to insert the attachment data as binary data into the table.

This is made like the original Bugzilla code with a prepared statment.

This fixed should be applied to ALL current Testopia versions.
Comment 2 Greg Hendricks 2010-08-16 09:46:04 PDT
Could you please attach a patch instead? It would be much easier to see what has changed rather than uploading the entire file. You can create a patch by using the diff -u command. You might also want to check out the latest version from CVS or BZR as any changes that might have been made since the version you are working with could be overwritten when the patch is applied. You would also be able to use cvs or bzr diff to make the patch in that case. Instructions can be found at https://wiki.mozilla.org/Bugzilla:Developers
Comment 3 Thomas Wabner 2010-09-10 08:50:14 PDT
Created attachment 474069 [details] [diff] [review]
patch for Attachment.pm with diff -u option between trunk and 2.2 Version

This is the requested patch. I have create the patch between trunk (http://bzr.mozilla.org/bugzilla/extensions/testopia/trunk/annotate/head:/extensions/Testopia/lib/Attachment.pm) and the Attachment.pm file from the 2.2 Version (ftp://ftp.mozilla.org/pub/mozilla.org/webtools/testopia/testopia-2.2-BUGZILLA-3.2.tar.gz)

The relevant changes are between line 99 and 111 in the patch file! The rest comes from differences between 2.2 and trunk.

Hope you can include the patch ... but be aware! I'am not a good or pure perl programmer ... this is just a quick fix (which works for us for sure) but should be reviewed.

Note You need to log in before you can comment on or make changes to this bug.