Forum OpenACS Q&A: Co-branding / Partner problem

Collapse
Posted by Jerry Adlersfluegel on
I'm trying to test out co-branding, and when I add a new partner in the Partner Manager (/admin/partner/partner-ae.tcl), I receive a

Server Error
The server encountered a configuration or operating system error while attempting to satisfy your request.

There is the default partner (ArsDigita) in the system, but I cannot add a new one. Any help would be appreciated.

Collapse
Posted by Don Baccus on
Please go to your server log when you trigger the error, and paste the  exact error here for us to take a look at.  Surrounding the error text with "pre" helps make it a lot more readable, if you don't mind.
Collapse
Posted by Jerry Adlersfluegel on
After filling out the form, the following error is logged:

[25/Jul/2000:08:52:37][14742.1625093][-conn13-] Error: nsd.tcl: can't read "db": no such variable
can't read "db": no such variable
    while executing
"with_transaction $db {

    dp_process -where_clause "partner_id=${dp.ad_partner.partner_id}"
} { ns_log Error "transaction failed" }"
    (file "/web/bender/www/admin/partner/partner-ae-2.tcl" line 21)
    invoked from within
"source $script"
    (procedure "ns_sourceproc" line 6)
    invoked from within
"ns_sourceproc cns152 {}"

The file partner-ae-2.tcl (which I've not modified) looks like this around line 21:

with_transaction $db {

    dp_process -where_clause "partner_id=${dp.ad_partner.partner_id}"
} { ns_log Error "transaction failed" }
Collapse
Posted by Jerry Adlersfluegel on
Does this look like I'm missing something, or is it a bug I should submit in the SDM?

Thank you.

Collapse
Posted by Jerry Adlersfluegel on
Ok, so I figured out that the file partner-ae-2.tcl is missing the set db [ns_db gethandle] and I added that. Now when I try to Edit header procedure (/admin/partner/partner-proc-ae-2.tcl), I get another Server Error, and the following is logged:

[02/Aug/2000:11:16:55][3611.1563653][-conn9-] Error: Ns_PgExec: result status: 7 message: ERROR:  Function 'decode(int4, int4, int4, int4)' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts

[02/Aug/2000:11:16:55][3611.1563653][-conn9-] Error: nsd.tcl: Database operation "1row" failed (exception NSDB, "Query was not a statement returning rows.")
Database operation "1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_db 1row $db [db_sql_prep $sql"
    (procedure "database_to_tcl_string" line 6)
    invoked from within
"database_to_tcl_string $db "select decode(count(*),0,0,1) 
                                          from ad_partner_procs 
                          ..."
    invoked from within
"set exists_p [database_to_tcl_string $db "select decode(count(*),0,0,1) 
                                          from ad_partner_procs 
            ..."
    (file "/web/bender/www/admin/partner/partner-proc-ae-2.tcl" line 17)
    invoked from within
"source $script"
    (procedure "ns_sourceproc" line 6)
    invoked from within
"ns_sourceproc cns65 {}"

Is the decode() function a built-in, or is that something that should have been defined in one of the www/doc/sql/*.sql files? A grep throught the files didn't turn up a create function decode anywhere.

Collapse
Posted by Don Baccus on
decode() doesn't exist in Postgres, so this was incorrectly ported.

We need to set up a scheme where we explictly assign modules to volunteers for maintenance...

I'll take a look at these problems, thanks, sorry for the delay after your last post.

Collapse
Posted by Don Baccus on
I've fixed these, and my primitive testing indicates it kinda works, at least...

Try it out some more and see what happens. Here's the new select without the "decode":

set exists_p [database_to_tcl_string $db "select case count(*) when 0 then 0 else 1 end
                                          from ad_partner_procs
                                          where url_id='$QQurl_id'
                                          and proc_name='$QQproc_name'
                                          and proc_id<>$proc_id
                                          and proc_type='$QQproc_type'"]

Collapse
Posted by Jerry Adlersfluegel on
That appears to have worked. Thanks for your assistance!

One more thing. I already reported the top bug to the SDM; should I report this one as well?

Collapse
Posted by Don Baccus on
Yeah, do so if you don't mind - I like having a history of bug fixes...
Collapse
Posted by Jerry Adlersfluegel on
It has been entered. Thanks for your help!