Wednesday 28 August 2013

Grails with Taggable crashes if deleting all but 1 tag

Grails with Taggable crashes if deleting all but 1 tag

I have a simple Grails application and one of the classes implements
Taggable. When testing with the Grails scaffolding and very basic user
interface for tags. When I delete a tag, everything is fine. When I delete
all the tags on an object, everything is fine. But if I try to delete all
but one, I get a Grails Runtime Error with the message, "Cannot cast
object 'groovytag' with class 'java.lang.String' to class
'java.util.List'" where groovytag was the single tag remaining. The error
sites this line:
objectInstance.tags = params.tags
Can anyone suggest what I need to do to get an object with only one tag?

No comments:

Post a Comment