Forum OpenACS Development: Re: Project Manager Todo List

Collapse
Posted by Alex Kroman on
When you try to add 2 or more tasks (and you get the old multiple edit page) it will give you this error when you try to create your tasks:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: null value in column "name" violates not-null constraint
CONTEXT: PL/pgSQL function "content_item__new" line 103 at SQL statement
PL/pgSQL function "pm_task__new_task_item" line 35 at assignment

OK, so it looks like content_item__new is not getting it's name passed to it.

In the database script we have:

   -- create the task_number
        if p_task_id is null then
           select
        else
           v_id := p_task_id;
        end if;

        v_item_id := content_item__new (
                v_id::varchar,          -- name

I changed the v_id to p_task_id and everything seems to work fine.

Obviously my change will break something else since timoh created this v_id variable in upgrade-3.0d7-3.0d8.sql

Any ideas on a fix?