[18163] commited by me yesterday (and reverted in [18165]) was
broken. I didn't restart rails when testing it because I thought lib/ was auto-refreshed as well and that: ruby -e 'x = []; x[0]["foo"] = "bar"' Would work and autovify like it does in Perl. But no, you have to do: ruby -e 'x = [{}]; x[0]["foo"] = "bar"' This commit is equivalent to [18163] aside from that fix to lib/potlatch.rb
This commit is contained in:
parent
d0c63b6d5d
commit
e0eb2b79b7
4 changed files with 61 additions and 30 deletions
|
@ -187,12 +187,11 @@ module Potlatch
|
|||
end
|
||||
|
||||
# Read POI presets
|
||||
icon_list=[]; icon_names={}; icon_tags={};
|
||||
icon_list=[]; icon_tags={};
|
||||
File.open("#{RAILS_ROOT}/config/potlatch/icon_presets.txt") do |file|
|
||||
file.each_line {|line|
|
||||
(icon,name,tags)=line.chomp.split("\t")
|
||||
(icon,tags)=line.chomp.split("\t")
|
||||
icon_list.push(icon)
|
||||
icon_names[icon]=name
|
||||
icon_tags[icon]=Hash[*tags.scan(/([^;=]+)=([^;=]+)/).flatten]
|
||||
}
|
||||
end
|
||||
|
@ -211,7 +210,7 @@ module Potlatch
|
|||
}
|
||||
end
|
||||
|
||||
[presets,presetmenus,presetnames,colours,casing,areas,autotags,relcolours,relalphas,relwidths,icon_list,icon_names,icon_tags]
|
||||
[presets,presetmenus,presetnames,colours,casing,areas,autotags,relcolours,relalphas,relwidths,icon_list,{},icon_tags]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue