SQL command issue in Media Library

Found a bug? Tell us!!
Post Reply
tim-e
Posts: 4
Joined: Sat Aug 05, 2006 2:12 am
Contact:

SQL command issue in Media Library

Post by tim-e »

Hi folks

I'm new to s9y... I have serendipity-devel-1.0.200607221338 / postgresql-server-7.4.13_1 / php5-5.1.4 / apache-2.2.2_1 / FreeBSD 7.0-CURRENT #0

When I add an image to the library, under a directory I've created under the Media Library's base, then click on Media Library, I get this:

Code: Select all

Warning: pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(5) in /usr/local/www/serendipity/include/db/postgres.inc.php on line 210
Error in INSERT INTO blog_images ( name, extension, mime, size, dimensions_width, dimensions_height, thumbnail_name, date, authorid, path, realname ) VALUES ( '1154736179.bsd-linux.jpg', 'backup', 'image/jpeg', 8849, 200, 205, 'serendipityThumb', 1154736307, 0, '', '1154736179.bsd-linux.jpg.backup' )
ERROR: value too long for type character varying(5)
array (
  0 => 
  array (
    'file' => '/usr/local/www/serendipity/include/functions_images.inc.php',
    'line' => 561,
    'function' => 'serendipity_db_query',
    'args' => 
    array (
      0 => 'INSERT INTO blog_images (
                    name,
                    extension,
                    mime,
                    size,
                    dimensions_width,
                    dimensions_height,
                    thumbnail_name,
                    date,
                    authorid,
                    path,
                    realname
                   ) VALUES (
                    \'1154736179.bsd-linux.jpg\',
                    \'backup\',
                    \'image/jpeg\',
                    8849,
                    200,
                    205,
                    \'serendipityThumb\',
                    1154736307,
                    0,
                    \'\',
                    \'1154736179.bsd-linux.jpg.backup\'
                   )',
    ),
  ),
  1 => 
  array (
    'file' => '/usr/local/www/serendipity/include/functions_images.inc.php',
    'line' => 1454,
    'function' => 'serendipity_insertImageInDatabase',
    'args' => 
    array (
      0 => '1154736179.bsd-linux.jpg.backup',
      1 => '',
    ),
  ),
  2 => 
  array (
    'file' => '/usr/local/www/serendipity/include/admin/images.inc.php',
    'line' => 771,
    'function' => 'serendipity_displayImageList',
    'args' => 
    array (
      0 => 1,
      1 => 2,
      2 => true,
    ),
  ),
  3 => 
  array (
    'file' => '/usr/local/www/serendipity/serendipity_admin.php',
    'line' => 268,
    'args' => 
    array (
      0 => '/usr/local/www/serendipity/include/admin/images.inc.php',
    ),
    'function' => 'include',
  ),
)
INSERT INTO blog_images ( name, extension, mime, size, dimensions_width, dimensions_height, thumbnail_name, date, authorid, path, realname ) VALUES ( '1154736179.bsd-linux.jpg', 'backup', 'image/jpeg', 8849, 200, 205, 'serendipityThumb', 1154736307, 0, '', '1154736179.bsd-linux.jpg.backup' )
Warning: pg_query() [function.pg-query]: Query failed: ERROR: currval of sequence "blog_images_id_seq" is not yet defined in this session in /usr/local/www/serendipity/include/db/postgres.inc.php on line 164

Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /usr/local/www/serendipity/include/db/postgres.inc.php on line 165

Warning: pg_last_oid(): supplied argument is not a valid PostgreSQL result resource in /usr/local/www/serendipity/include/db/postgres.inc.php on line 169
Then I get the Media Library page rendered below it. The image name is bsd-linux.jpg and the directory I've created and put the file in is called Images. If I delete the file, and click on Media Library again, the error is (obviously) gone.

Am I doing something wrong? :roll:
tim-e
Posts: 4
Joined: Sat Aug 05, 2006 2:12 am
Contact:

Post by tim-e »

Weird. I went away all afternoon, came back and just clicked on my Media Library again and there was no error. Nothing's been changed though.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

In fact you uploaded a file ".jpg.backup" which caused the error! s9y can only handle extensions with a maximum of 5 extension letters, so ".backup" makes an error.

But of course this should be caught in the code as well, I'll try to find a way for that!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tim-e
Posts: 4
Joined: Sat Aug 05, 2006 2:12 am
Contact:

Post by tim-e »

Hi Garvin

I thought of that - but I didn't call the file ".backup" in the first place... I "side-loaded" the image from http://www.bralug2.de/tuxlogo/logos/bsd-linux.jpg, not uploaded from my computer. Just thought you'd like to know. :)

-tim
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

This ".backup" file can currently only be created when you use the cropping functionality of s9y 1.1. This is still in alpha stage and not final yet, so you shouldn't actively use this yet :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tim-e
Posts: 4
Joined: Sat Aug 05, 2006 2:12 am
Contact:

Post by tim-e »

Aah. I see. Got it now, thanks! :wink:
Post Reply