| Issue 96: | PATCH The system crashes when passing an invalid tag in the front face site. | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Enter an URL that have an invalid tag at the address bar. i.e. http://localhost:3000/store/show_by_tags/invalid What is the expected output? What do you see instead? It should handle it gracefully. It crashes with an ActiveRecord::StatementInvalid exception. What version of the product are you using? On what operating system? trunk. Ubuntu 7.10 Please provide any additional information below. The show_by_tags method don't validate the data after trying to get it from the database. Even when empty it tries to use it. Now, if any tag or subtag is not found, it redirects to index with a flash message indicating the problem tag.
Jun 10, 2008
#1
patrickb...@gmail.com
Jun 10, 2008
if @tag_names.empty?
redirect_to :controller => 'homepage', :action => 'index' and return false
else
for name in @tag_names
temp_tag = Tag.find_by_name(name)
if temp_tag then
tag_ids_array << temp_tag.id
else
flash[:notice] = "Sorry, we couldn't find the tag #{name} you were looking
for."
redirect_to :controller => 'homepage', :action => 'index' and return false
end
end
end
Jun 10, 2008
thanks. fixed.
Jun 14, 2008
Thanks for the heads up. Fixed in r91, but instead of using a flash I'm rendering a 404 page, which is the expected behavior for things of this nature. No reason to reinvent the wheel ;)
Status:
Fixed
|