Hi Peter,
try the attached patch, it sets a dummy value (application/octet-stream)
when the file get’s opened. So we dont violate the NOT NULL constrain.
Ralf
Peter Goerzen schrieb:
Hi,
I’m having trouble attaching files to calendar and infolog entries via the “Links” tab in the Web interface. I get the following in Apache’s error log:
PHP Warning: copy(links://default/apps/calendar/11586/link-diagram.png) [function.copy]: failed to open stream: “links_stream_wrapper::stream_open” call failed in /usr/share/egroupware/phpgwapi/inc/class.egw_link.inc.php on line 750
It seems the problem is in sqlfs_stream_wrapper::stream_open, which is returning false in line 209. At this point, self::$pdo->errorInfo() returns Array([0] => 00000[1] => 7[2] => ERROR: null value in column “fs_mime” violates not-null constraint). Looks like fs_mime doesn’t get set until the stream is closed.
Can anyone else reproduce this?
I’m using trunk r25988, and my Postgres table description is below.
Thanks!
Peter
Table "public.egw_sqlfs"
Column | Type | Modifiers
-------------±----------------------------±----------------------------------------------------------
fs_id | integer | not null default nextval(‘egw_sqlfs_fs_id_seq’::regclass)
fs_dir | integer | not null
fs_name | character varying(200) | not null
fs_mode | smallint | not null
fs_uid | integer | not null default 0
fs_gid | integer | not null default 0
fs_created | timestamp without time zone | not null default now()
fs_modified | timestamp without time zone | not null
fs_mime | character varying(64) | not null
fs_size | bigint | not null
fs_creator | integer | not null
fs_modifier | integer |
fs_active | boolean | not null default true
fs_comment | character varying(255) |
fs_content | bytea |
Indexes:
“egw_sqlfs_pkey” PRIMARY KEY, btree (fs_id)
“egw_sqlfs_fs_dir_fs_active_fs_name” btree (fs_dir, fs_active, fs_name)
–
Ralf Becker
Director Software Development
Stylite GmbH
[open style of IT]
Morschheimer Strasse 15
67292 Kirchheimbolanden
fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
cell +49 (0) 170 7815917
mailto: rb@stylite.de
www.stylite.de
www.egroupware.org
Geschäftsführer Andre Keller, Nigel John Vickers,
Gudrun K. Müller und Ralf Becker
Registergericht Kaiserslautern HRB 12087