Photo Organizer

This is the bug tracker for Photo Organizer.
Tasklist

FS#370 - Can`t empty trash in v2.36-rc2

Attached to Project: Photo Organizer
Opened by Alexander (banan) - Tuesday, 29 July 2008, 07:34 GMT
Last edited by Solomon Peachy (pizza) - Friday, 01 August 2008, 20:55 GMT
Task Type Bug Report
Category Backend / Core
Status Closed
Assigned To No-one
Operating System UNIX
Severity Medium
Priority Normal
Reported Version Devel
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Can`t empty trash in v2.36-rc2

System: FreeBSD 7.0-RELEASE

Programs:

postgresql-server-8.3.3
apache-2.2.9
php5-5.2.6
php5-bcmath-5.2.6
php5-pcre-5.2.6
php5-pgsql-5.2.6_1
php5-session-5.2.6
php5-xml-5.2.6
nginx-0.6.32

When I want to empty trash, in my browser I see red line at the top of page with one yellow point.
In system log:

postgres[67867]: [6-1] ERROR: operator does not exist: text = integer
postgres[67867]: [6-2] HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
postgres[67867]: [6-3] STATEMENT: delete from user_preferences where key = 'watermark_photo' and value in (select v.identifier from photo_version v,
postgres[67867]: [6-4] photo p where p.identifier = v.photo and v.photo in (select p2.identifier from photo p2 where p2.folder = 1))

In trash.empty.php I found function nuke_photos

This function in include/common.php

So I comment section with expression 'watermark_photo'

// if ($result) {
// // Nuke any watermark preferences that use this photo
// $result = pg_query($database, "delete from user_preferences where key = 'watermark_photo' and value in (select v.identifier from photo_version v, photo p
// }

now I can empty trash. But ..
This task depends upon

Closed by  Solomon Peachy (pizza)
Friday, 01 August 2008, 20:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  Confirmed fixed. There are probably similar bugs lurking, but we'll fix 'em when we get to 'em.
Comment by Solomon Peachy (pizza) - Tuesday, 29 July 2008, 11:58 GMT
First, let me say thankyouthankyouthankyou for including lots of detail in this bug report.

Second, this bug is due to PG 8.3.x being a lot stricter than PG 8.2.x, and no longer performing implicit typecasting. I don't have a PG 8.3.x installation to test against, so there will probably be more bugs like this lurking in dark corners.

It's easy enough to fix, fortunately. Change:

... delete from user_preferences where key = 'watermark_photo' and value in (select v.identifier from photo_version v ...

to

... delete from user_preferences where key = 'watermark_photo' and value in (select text(v.identifier) from photo_version v ...

Let me know if this works. If so, I'll commit it for the 2.36-final release.
Comment by Alexander (banan) - Tuesday, 29 July 2008, 16:06 GMT
Yes. It works :)

Loading...