Bugs #2829: Deleted categories still in adressentry in database

Ticket modified by Birgit Becker at 2011/02/18 07:50
Tracking System: Bugs
Category: Addressbook
Version: Version 1.8.001
Status: Open
Resolution: None
Completed: 50%
Priority: 5 - medium
Created By: Joachim Bachmann
Created on: 2011/01/31 20:08
Assigned to: Nathan Gray
Summary: #2829 - Deleted categories still in adressentry in database
We deleted a bunch of categories from our adressbook to reasign the adresses them.

The categories are deleted from the table egw_categories, but they are still listet in egw_adressbook column cat_id.

There should have been a lot adresses without any categorie, wich should have been shown in the adressbook with the filter categories:none but they weren’t because the old category id’s where still in cat_id.

So when deleting a category from eGW every dataset has to be updated and the old cat_ids have to be deleted.

I haven’t testet yet if this problem also occures with other applications than the adressbook.
Comment by Birgit Becker at 2011/02/18 07:50:
Hi Nathan,

tested it on trunk and works for me.

One small issue: as the category is deleted it can not be shown in the history of the contacts (where the category was used), for history-issues it would be interesting to show there the cat_id if the cat is deleted. Ralf mentioned this can/nedd be done in eTemeplate for the history-widget. Maybe you can have a look on that.

The hook should be backported to EPL 10.1 and 1.8.

Birgit
Comment by Nathan Gray at 2011/02/15 09:07:
Done. Calls are to bo layer now, using search(…, false) to get entries.
Comment by Ralf Becker at 2011/02/15 06:47:
Hi Nathan,
current approach, calling addressbook_so::save() with only contact_id and cat_id, has certain problems:

  • contenthistory table, important for SyncML, get’s not update --> change get not synced
  • custom fields can get lost, as they are not set in the data when calling save
    ==> please use addressbook_bo::search(,false) to read full contacts and addressbook_bo::save() to update also contenthistory table (and whatever else is required for complete updates)
    Ralf
    Comment by Nathan Gray at 2011/02/10 13:49:
    Ready for testing in trunk.
    SVN r33733, 33734
    Comment by Birgit Becker at 2011/02/04 08:24:
    Hi Nathan,

can you please add a hook for adressbook, that deleting categories will also delete the category in all entrys

We have that sort of hook already for knowledgebase - please implement it analogous.

Please commit first only to trunk

Thanks Birgit
Comment by Birgit Becker at 2011/02/04 08:22:
Hi Joachim,

we started that using hooks but its not implemented for the most applications. Take that as a bug/missing feature …

Birgit

linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2829&no_popup=1