Open Bug 576524 Opened 13 years ago Updated 11 years ago
Could not upload images
22.38 KB, application/octet-stream
6.99 KB, patch
|Details | Diff | Splinter Review|
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:18.104.22.168) 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 "UTF8": 0xff HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". [for Statement "INSERT INTO test_attachment_data (attachment_id, contents) VALUES(?,?)"] 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
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.
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
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.
You need to log in before you can comment on or make changes to this bug.