# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1243361017 -7200 # Tue May 26 20:03:37 2009 +0200 # Node ID bacbad3c5f29dc17717d5c723a1b30fe36a14fa6 # Parent 2b97e776053768e6e07f0afd44e15a4b303a33c4 fix #343423: editing an existing comment creates a new comment diff --git a/data/cubes.comment.js b/data/cubes.comment.js --- a/data/cubes.comment.js +++ b/data/cubes.comment.js @@ -1,6 +1,6 @@ /* * :organization: Logilab - * :copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. + * :copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. * :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr */ diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -164,6 +164,7 @@ __select__ = implements('Comment') jsfunc = "processComment(%s, '%s')" + jsonmeth = 'edit_comment' def cell_call(self, row, col): self.comment_form(self.entity(row, col)) @@ -175,7 +176,7 @@ # hack to avoid tabindex conflicts caused by Ajax requests self.req.next_tabindex = count(20).next jseid = dumps(commented.eid) - buttons = [Button(onclick=self.jsfunc % (jseid, 'add_comment')), + buttons = [Button(onclick=self.jsfunc % (jseid, self.jsonmeth)), Button(stdmsgs.BUTTON_CANCEL, onclick=self.jsfunc % (jseid, ''))] form = self.vreg.select_object('forms', 'edition', self.req, @@ -192,6 +193,8 @@ id = 'inlinecommentform' __select__ = match_kwargs('commented') # explicit call when it makes sense + jsonmeth = 'add_comment' + def call(self, commented): self.initialize_varmaker() newcomment = self.vreg.etype_class('Comment')(self.req)