kpumuk / meta-tags

Search Engine Optimization (SEO) for Ruby on Rails applications.
MIT License
2.73k stars 275 forks source link

"can't modify frozen object" #1

Closed gauda closed 12 years ago

gauda commented 14 years ago

got this error in normalize_title(title) line 211 and following in view_helper.rb. to fix it, add title = title.dup if title.frozen? as first line in the function.

kpumuk commented 14 years ago

Could you show an example on how to reproduce this error? I've tried a few variations and can't get it failing:

  @view.title('someTitle'.freeze)
  @view.display_meta_tags(:site => 'someSite').should == '<title>someSite | someTitle</title>'

  @view.title(['someTitle'.freeze].freeze)
  @view.display_meta_tags(:site => 'someSite').should == '<title>someSite | someTitle</title>'
marius commented 14 years ago

It is only happening in production mode, and only for some pages. We couldn't figure out what triggers this. The backtrace shows that the error occurs on the line with .map inside normalize title. Maybe rails does some caching for strip_tags or h and freezes the resulting string?

Can you somehow test in production? Maybe with some tags and unescaped html entities in the title.

kpumuk commented 14 years ago

Added frozen strings in production everywhere. No exceptions. Could you help me to find the problem?

marius commented 14 years ago

Sorry, I have no idea what to do. Maybe it's one of the other gems or plugins we are using.

kpumuk commented 12 years ago

Closing issue since, there is no new information. Please re-open or create a new issue if you still having this problem.