Forum .LRN Q&A: event in a community calendar breaks portlet?

Hi, I am using PG7.2 and AOLserver/3.3.1+ad13. When I add an event in a community calendar, in /dotlrn I get the following error:
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

06/Nov/2002:09:48:40][994.7][-conn1-] Notice: BMA- t
[06/Nov/2002:09:48:40][994.7][-conn1-] Debug: PgBindCmd: sql = 
    select    calendar_id
    from      calendars
    where     owner_id = :party_id
    and       private_p = 't'
    
[06/Nov/2002:09:48:40][994.7][-conn1-] Debug: PgBindCmd: bind var: party_id = 2610
[06/Nov/2002:09:48:40][994.7][-conn1-] Debug: PgBindCmd: query with bind variables substituted = 
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't'
    
[06/Nov/2002:09:48:40][994.7][-conn1-] Notice: Querying '
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't';'
[06/Nov/2002:09:48:40][994.7][-conn1-] Notice: dbinit: sql(localhost:5433:rafa): '
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't'
    '
[06/Nov/2002:09:48:40][994.7][-conn1-] Error: *** portal::render_element show callback Error! ***

 Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")


[06/Nov/2002:09:48:40][994.7][-conn1-] Debug: NO FULLQUERY FOR dbqd.dotlrn.tcl.dotlrn-security-procs.dotlrn::user_p.select_count --> using default SQL

The code is fresh from cvs (oacs-4-6) Any guess?
Collapse
Posted by Andrew Smith on
Hi,
I am finding the same problem.
[08/Nov/2002:10:20:04][10209.7176][-conn4-] Notice: dbinit: sql(localhost:5431:dotlrn): '
    select    calendar_id
    from      calendars
    where     owner_id = '2610'
    and       private_p = 't'
    '
[08/Nov/2002:10:20:04][10209.7176][-conn4-] Error: *** portal::render_element show callback Error! ***

 Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.") 

Did you find a solution for the same ?
Regards.
Collapse
Posted by Arjun Sanyal on
what does the select return when you do it in psql?

if it's returning more than one private calendar for a given party_id something is broken elsewhere. there is an assumption in the calendar code that there's only one calendar for a given group.

Collapse
Posted by Andrew Smith on
Hi,
It returns two rows
dotlrn=# select    calendar_id from      calendars where     owner_id = '2610' and       private_p = 't' ;
 calendar_id 
-------------
        5468
        6537
(2 rows)
Thanks.
Collapse
Posted by Caroline Meeks on
Collapse
Posted by Rafael Calvo on
Caroline,

I changed the query but still get the same error.
Is it correct to get more than one calendar?

Collapse
Posted by Ben Adida on
There is definitely a consistency issue here. At first, calendar was meant to not be multi-instantiated, thus there would only be one calendar package for the whole system, multi-mounted.

But that's not how things currently work. It looks like there is a bit of work here to clean this up and do something consistent - my bad for not finding a full solution to this. The issue to resolve is that calendars is kind of a multi-instance package within itself with the idea of multiple calendars.

But putting that aside for a second: since the current system is creating private calendars for each calendar package, at the very least what should happen is that you are only selecting the private calendar for the package you are in - thus adding a package constraint in your where clause.

(Rafael: you're still failing because the two private calendars are already created, so changing the creation condition won't fix your issue).

Collapse
Posted by Rafael Calvo on
Ben,

OK, I can add the clause in the query again. But how can I get this to work?

I am not sure what I did different from any other instalation.
I mean if I start from scratch, is there a way of preventing this, or no until you fix this? and if this is the case, do you know how long it could take?
I wish I could help more with the coding.. but I least I hope to help with this type of reporting.

Collapse
Posted by Mohan Pakkurti on
hi Ben!

Any update to this issue? Is this an issue for just the postgres port, or for Oracle also?

Thanks

Collapse
Posted by Peter Marklund on
I implemented a temporary workaround for this problem (both Oracle and PG), see: this patch. Not sure what the correct solution is yet. How is this problem solved in SloanSpace? Where can I access the SloanSpace codebase?