From ea426438cf7d580336e88d2c14c2c7595c9adea1 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 17 Mar 2015 12:46:21 -0400 Subject: [PATCH] Fix for reloading tools. Previously, when a tool was reloaded (of the same version), you would get the new/correct tool when clicking in Tool Panel, but the rerun button would return the old/pre-reload tool; this is due to the reload not replacing the entries in _tool_versions_by_id. --- lib/galaxy/tools/toolbox/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tools/toolbox/base.py b/lib/galaxy/tools/toolbox/base.py index 9e469ba9659..969dd39da11 100644 --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -978,7 +978,9 @@ class AbstractToolBox( object, Dictifiable ): if tool_key in val.elems: self._tool_panel[ key ].elems[ tool_key ] = new_tool break - self._tools_by_id[ tool_id ] = new_tool + # (Re-)Register the reloaded tool, this will handle + # _tools_by_id and _tool_versions_by_id + self.register_tool( new_tool ) message = "Reloaded the tool:
" message += "name: %s
" % old_tool.name message += "id: %s
" % old_tool.id