On Monday, 20. March 2006 16:08, Andreas Bauer wrote:
So the correct solution is to check if a file tag exists before calling the
file method:
- if @package.file("@filename='#{filename}'") - if @package.has_element?(:file) and
@package.file("@filename='#{filename}'")
Quite unreadable, so here is the real patch... Index: package_controller.rb =================================================================== --- package_controller.rb (Revision 55) +++ package_controller.rb (Revision 79) @@ -107,7 +107,7 @@ end filetype = params[:filetype] - if @package.file("@filename='#{filename}'") + if @package.has_element? :file and @package.file("@filename='#{filename}'") @package.remove_file filename flash_message = "File '#{filename}' replaced successfully" else -- Andreas Bauer - Novell - SUSE Internal Tools