https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20947

--- Comment #2 from Barton Chittenden <[email protected]> ---
(In reply to Jonathan Druart from comment #1)
> I do not recreate, I noticed that accountlines.itemnumber is set to NULL
> when the item is deleted.
> Can you detail a bit more the steps to recreate?

The problem is triggered by accountlines records that have itemnumbers that
don't point to items -- I honestly don't know *how* that happened -- manual
database manipulation? Accountlines records that existed before the foreign key
constraints?

I think as a work-around, we're going to simply null accountlines.itemnumber
and set accountlines.note using

UPDATE
    accountlines
SET
    note=CONCAT(itemnumber," item deleted from system"),
    itemnumber=NULL
WHERE
    itemnumber NOT IN ( SELECT itemnumber FROM items );

I'm still open to a patch for this; but considering that the code that causes
his no longer exists in master, and that I can't reproduce this by normal means
in 17.11, I'm willing to use the workaround.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to