Deleting tagged resource causes KeyError

Bug #357021 reported by Paul Everitt
2
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Medium
Tres Seaver

Bug Description

Deleting a resource with a tag causes a KeyError when visiting the page for that tag. Looks like we need the karl.models.subscribers.unindex_content to have a similar subscriber for delete?

Reproduce
============

1) Create a blog entry (or some other resource).

2) Tag it with "tag1".

3) Click on the word "tag1" in the blue bubble to visit the tag page for tag1.

4) Shift-click on the link for your blog entry to revisit the blog entry in a new window.

5) Click Delete to remove the blog entry.

6) Go back to the window with tag1's tag page and reload.

7) You get an exception:

File '/Users/paul/projects/bfgkarl-2.5/eggs/zope.interface-3.5.0-py2.5-macosx-10.3-i386.egg/zope/interface/adapter.py', line 482 in queryMultiAdapter
  result = factory(*objects)
File '/Users/paul/projects/bfgkarl-2.5/src/karl/karl/views/tags.py', line 184 in showtag_view
  raise KeyError(docid)
KeyError: 1371109149

Tags: tagging
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

I'll work on a Twill test for this, presuming that we have an extension command for handling tagging.

Changed in karl3:
assignee: nobody → tseaver
importance: Undecided → Medium
milestone: none → m9
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

I just checked in some Twill changes:

1) karlcommands.py now has a add_tag command. It adds a tag to the current resource as the logged in user, whether that tag has or hasn't been applied yet.

2) I made a tagging directory where we can put tag related Twill tests, starting with a single test.

3) The basic karl3.tsuite got that Twill test added at the end.

If you run:

  $ ./runtests.sh

...once, it works. If you run it again, it fails, because /showtag/tag85 reports an error (the error above).

Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 357021] Re: Deleting tagged resource causes KeyError

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Everitt wrote:
> I just checked in some Twill changes:
>
> 1) karlcommands.py now has a add_tag command. It adds a tag to the
> current resource as the logged in user, whether that tag has or hasn't
> been applied yet.
>
> 2) I made a tagging directory where we can put tag related Twill tests,
> starting with a single test.
>
> 3) The basic karl3.tsuite got that Twill test added at the end.
>
> If you run:
>
> $ ./runtests.sh
>
> ...once, it works. If you run it again, it fails, because
> /showtag/tag85 reports an error (the error above).

Prior to revision ####, deleting a tagged item left turs in the 'tags'
tool. Running 'start_over --yes' after an 'svn up' inside 'src/karl'
should resolve that issue. We may still have a problem for "nested"
objects after the container is deleted.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ25On+gerLs4ltQ4RAtw2AKCwP0rr29xrN4gAPh2+P/Ia4Wx3TACfTpbK
TjMD++qD37yZGRQMroe7CpE=
=rpRj
-----END PGP SIGNATURE-----

Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tres Seaver wrote:
> Paul Everitt wrote:
>> I just checked in some Twill changes:
>
>> 1) karlcommands.py now has a add_tag command. It adds a tag to the
>> current resource as the logged in user, whether that tag has or hasn't
>> been applied yet.
>
>> 2) I made a tagging directory where we can put tag related Twill tests,
>> starting with a single test.
>
>> 3) The basic karl3.tsuite got that Twill test added at the end.
>
>> If you run:
>
>> $ ./runtests.sh
>
>> ...once, it works. If you run it again, it fails, because
>> /showtag/tag85 reports an error (the error above).
>
> Prior to revision ####, deleting a tagged item left turs in the 'tags'
> tool. Running 'start_over --yes' after an 'svn up' inside 'src/karl'
> should resolve that issue. We may still have a problem for "nested"
> objects after the container is deleted.

Cleaning up the children now done, by centralizing the computation of
to-be-removed docids in a new event handler, and passing them through to
'unindex_object' and 'cleanup_content_tags'.

Status: fixcommitted

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ251S+gerLs4ltQ4RAs0lAKCKVb1lEaPMDFCZtWaspveKjPCxAgCffgYM
PMTATAbuhf4ileiuVfCjvCI=
=VIsA
-----END PGP SIGNATURE-----

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Weird, this said it was still at status=="New". Changing to "Fix Committed".

Changed in karl3:
status: New → Fix Committed
Changed in karl3:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.