≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1197

Bug #1197: Using AJAX editing fields wipes out tags on issues

Kind bug
Product wincent.dev
When 2009-01-17T19:12:27Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

To reproduce:

  1. Visit an issue with some tags on it
  2. Use and submit an in-place editor field (the summary, for instance); evidently you can only do this if you are logged in as an administrator
  3. Refresh the page; and note that your tags are no longer present

So, have to rethink this stuff. In the meantime, mustn't use the AJAX in-place editors.

Comments

  1. Greg Hurrell 2009-01-17T19:32:43Z

    Ok, this is not actually anything to do with AJAX. You can repro this from the console touching only Issue objects. This is a bug in the acts_as_taggable implementation:

    >> i=Issue.first
    >> i.tag "foo"
    >> i.tags # look, it has tags
    >> i.save
    >> i.tags # look, the tags went away on save

    Basically, whenever you save a record, the tags will be blown away unless the pending_tags attribute is set. It's always set when you do issues#new or issues#edit, but not when you're submitting an AJAX in-place form, or using the console like in the example.

    Looks like this bug has been there from day one, but I'd never noticed it because tags were never exposed in the issues interface before, and issues is really the only model where I'm editing from a place other than #new or #edit actions.

    One solution would be to pre-populate pending_tags whenever I load an object, but I don't think I am going to go that way as that will incur a database hit. I'm going to see if there's a way to detect when pending_tags has really been set to nothing (), and when it's merely not been set (nil).

  2. Greg Hurrell 2009-01-17T19:47:31Z

    Ok, I believe I've fixed this now.

Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets