6.0.0-beta1
7/12/25

[#14112] tags not being cleaned from rampage tables when tagged object is deleted
Summary tags not being cleaned from rampage tables when tagged object is deleted
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester jsveiga (at) it (dot) eng (dot) br
Created 09/15/2015 (3588 days ago)
Due
Updated 09/25/2015 (3578 days ago)
Assigned 09/16/2015 (3587 days ago)
Resolved 09/16/2015 (3587 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
09/25/2015 02:33:02 PM Michael Rubinsky Comment #11 Reply to this comment
Done.
09/23/2015 04:55:12 PM Jan Schneider Comment #10 Reply to this comment
This still needs to be BFN'ed.
09/16/2015 05:17:01 PM Git Commit Comment #9 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 9522f40eb957d4fa2d94a84677f13dd0694a12dc
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 12:41:02 2015 -0400

     Bug: 14112 Remove the object from the Content app when deleting.

  kronolith/lib/Driver.php |    4 ++++
  mnemo/lib/Driver.php     |    9 +++++++++
  nag/lib/Driver.php       |   16 ++++++++++++----
  turba/lib/Driver.php     |   14 +++++++++++---
  4 files changed, 36 insertions(+), 7 deletions(-)

http://github.com/horde/horde/commit/9522f40eb957d4fa2d94a84677f13dd0694a12dc
09/16/2015 05:16:56 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 8979b2f5dca0246a2ae8289492f14234c7e47050
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 11:37:42 2015 -0400

     Only increment counters if we actually tagged the item.

     Related to Bug: 14112

  content/lib/Tagger.php |   16 ++++++++--------
  1 files changed, 8 insertions(+), 8 deletions(-)

http://github.com/horde/horde/commit/8979b2f5dca0246a2ae8289492f14234c7e47050
09/16/2015 05:16:50 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit f7725beb730407fb3f38d521a62eb532b5a50b4a
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 11:21:31 2015 -0400

     Bug: 14112 Remove tags when deleting objects.

  mnemo/lib/Driver.php |    7 +++++++
  nag/lib/Driver.php   |    9 ++++++++-
  turba/lib/Driver.php |   10 +++++++++-
  3 files changed, 24 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/f7725beb730407fb3f38d521a62eb532b5a50b4a
09/16/2015 04:59:51 PM Michael Rubinsky Comment #6
State ⇒ Resolved
Reply to this comment
Fixed in various applications and Content.
09/16/2015 04:50:44 PM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (master):

commit f20348e01030c3769b410b3128e689dc9368bed7
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 12:41:02 2015 -0400

     Bug: 14112 Remove the object from the Content app when deleting.

  kronolith/lib/Driver.php |    4 ++++
  mnemo/lib/Driver.php     |    9 +++++++++
  nag/lib/Driver.php       |   16 ++++++++++++----
  turba/lib/Driver.php     |   14 +++++++++++---
  4 files changed, 36 insertions(+), 7 deletions(-)

http://github.com/horde/horde/commit/f20348e01030c3769b410b3128e689dc9368bed7
09/16/2015 03:49:37 PM Michael Rubinsky Comment #4
State ⇒ Assigned
Assigned to Michael Rubinsky
Reply to this comment

[Show Quoted Text - 9 lines]
This was originally due to the fact that Content/Rampage is not only 
concerned with tags. The idea was this was to be used to map any 
related content together. This still may happen, but it's not 
currently implemented.  In other words, we can't just delete the 
object reference when the tag count goes to zero, but only when the 
object is explicitly deleted. I'll add code to do this, but need to 
think about where it will go, since it doesn't really belong in a 
Tagger class.
rampage_tag_stats still keeps the usage count including the deleted object
This was true for all applications except for Kronolith, which 
actually did it correctly but there was an error in Content_Tagger 
that would essentially increment the count anytime tags were edited 
and still contained some of the same tags. So, e.g., adding a new tag 
after the object already contained tags would increment the count for 
ALL tags, not just the added one. This has been fixed in Git.

09/16/2015 03:40:32 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (master):

commit 26c3700dc513e295b3fd5c9c6b88c225639d5cc6
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 11:37:42 2015 -0400

     Only increment counters if we actually tagged the item.

     Related to Bug: 14112

  content/lib/Tagger.php |   16 ++++++++--------
  1 files changed, 8 insertions(+), 8 deletions(-)

http://github.com/horde/horde/commit/26c3700dc513e295b3fd5c9c6b88c225639d5cc6
09/16/2015 03:40:21 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 1b3e4edde4397772bfc1ca0f6db63c0de48ee109
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Sep 16 11:21:31 2015 -0400

     Bug: 14112 Remove tags when deleting objects.

  mnemo/lib/Driver.php |    7 +++++++
  nag/lib/Driver.php   |    9 ++++++++-
  turba/lib/Driver.php |   10 +++++++++-
  3 files changed, 24 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/1b3e4edde4397772bfc1ca0f6db63c0de48ee109
09/15/2015 04:33:13 PM jsveiga (at) it (dot) eng (dot) br Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ tags not being cleaned from rampage tables when tagged object is deleted
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Versions:
Horde 5.2.2
Turba H5 (4.2.2)
Kronolith H5 (4.2.2)
Mnemo H5 (4.2.1)

rampage_* tables not updated when a tagged object is deleted:

rampage_objects still keeps the deleted object reference

rampage_tag_stats still keeps the usage count including the deleted object

rampage_user_tag_stats still keeps the usage count including the 
deleted object

How to reproduce:

1 - Create two calendar events and tag them with 'tagpersistencetest_calendar'

2 - Create two contacs and tag them with 'tagpersistencetest_contact'

3 - Create two notes and tag them with 'tagpersistencetest_notes'

4 - Run this query on the database:

SELECT
rampage_tags.tag_name,
rampage_tag_stats.count as tagcount,
rampage_user_tag_stats.count as usertagcount,
rampage_objects.object_name,
rampage_types.type_name
from
rampage_tags
left join rampage_tag_stats using (tag_id)
left join rampage_user_tag_stats using (tag_id)
left join rampage_tagged using (user_id, tag_id)
left join rampage_objects using (object_id)
left join rampage_types using (type_id)
where tag_name regexp 'tagpersistencetest_';

5 - Verify the usage count and tagged objects; take note of [object_id]s

6 - Delete (UI) the created notes, contacts and events.

7 - Re-run the query

Result:

The note and contact objects and tags/tag count remain the same in all tables.

The event object is no longer in rampage_tagged, but still in 
rampage_objects (look for its object_id), and the tage is still in 
rampage_tags, rampage_tag_stats, and rampage_user_tag_stats.

Expected:

Deleted object should be removed from rampage_objects and 
rempage_tagged, tag counters should decrement.

Saved Queries