[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3615] trunk



Revision: 3615
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3615&view=rev
Author:   einhverfr
Date:     2011-08-03 19:27:57 +0000 (Wed, 03 Aug 2011)

Log Message:
-----------
Bytea's now save correctly

Modified Paths:
--------------
    trunk/LedgerSMB/File.pm
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB/File.pm
===================================================================
--- trunk/LedgerSMB/File.pm	2011-08-03 18:10:46 UTC (rev 3614)
+++ trunk/LedgerSMB/File.pm	2011-08-03 19:27:57 UTC (rev 3615)
@@ -297,13 +297,15 @@
 =cut
 
 sub exec_method{
+    use DBD::Pg qw(:pg_types);
     my ($self, $args) = @_;
     if (!$args->{args}){
           $self->dbobject->{attached_by_id} = $self->attached_by_id;
           $self->dbobject->{attached_by}    = $self->attached_by;
           $self->dbobject->{attached_at}    = $self->attached_at;
           $self->dbobject->{reference}      = $self->reference;
-          $self->dbobject->{content}        = $self->content;
+          $self->dbobject->{content}        = {value => $self->content,
+                                                type => DBD::Pg::PG_BYTEA};
           $self->dbobject->{mime_type_id}   = $self->mime_type_id;
           $self->dbobject->{mime_type_text} = $self->mime_type_text;
           $self->dbobject->{file_name}      = $self->file_name;

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2011-08-03 18:10:46 UTC (rev 3614)
+++ trunk/LedgerSMB.pm	2011-08-03 19:27:57 UTC (rev 3615)
@@ -767,7 +767,8 @@
     # that off for another day. --CT
     foreach my $carg (@call_args){
         if (ref($carg) eq 'HASH'){
-            $sth->bind_param($place, $carg->{value}, $carg->{type}); 
+            $sth->bind_param($place, $carg->{value}, 
+                       { pg_type => $carg->{type} });
         } else {
             $sth->bind_param($place, $carg);
         }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.