My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 22: Updating a tag with an invalid name creates a DoubleRenderError
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Apr 2008


 
Reported by edmundo...@gmail.com, Feb 22, 2008
What steps will reproduce the problem?
1. Access the admin interface.
2. Create a tag.
3. Edit it try to save it with an empty or duplicated name.

What is the expected output? What do you see instead?
Some kind of of error message. What happens is a popup message saying that
occurred a communication error with the server and the method crashes (only
in the console) lefting the edit box with its spining gif giving an idea
that it is doing something (of course it isnt, its just a animated picture) 

What version of the product are you using? On what operating system?
trunk. Ubuntu 7.04

Please provide any additional information below.

The console shows:

ActionController::DoubleRenderError (Can only render or redirect once per
action):
    /vendor/rails/actionpack/lib/action_controller/base.rb:833:in
`render_with_no_layout'
    /vendor/rails/actionpack/lib/action_controller/layout.rb:270:in
`render_without_benchmark'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
`render'
....

The method executed really have a double render problem:

def update
  ...
  if !@tag.save
    render(:update) do |page| 
      ...
    end
  end
  render(:update) do |page| 
    ...
  end
end

If the tag is not saved render, then at the end render again. It should be:

def update
  ...
  if !@tag.save
    render(:update) do |page| 
      ...
    end
  else
    render(:update) do |page| 
      ...
    end
  end
end

This fixes the error but not the behavior of the field that cannot be
clicked to be saved again.
Apr 8, 2008
Project Member #1 subim...@gmail.com
Fixed by rev #47
Status: Fixed

Powered by Google Project Hosting