lib/fiona7/builder/obj_builder.rb in infopark_fiona7-1.5.5.4.1 vs lib/fiona7/builder/obj_builder.rb in infopark_fiona7-1.5.5.5.0
- old
+ new
@@ -210,14 +210,24 @@
def rewrite_full_text
full_text = ::YAML.load(@obj.attr_values["X_full_text"]) rescue {}
full_text = {} unless full_text.kind_of?(Hash)
full_text["_widget_pool"] ||= {}
- full_text["_widget_pool"].deep_merge!(@widget_pool)
+ full_text["_widget_pool"].deep_merge!(filtered_widget_pool)
full_text.to_yaml
rescue => e
Rails.logger.error("Unable to store information for search engine: #{e.message}")
nil
+ end
+
+ def filtered_widget_pool
+ (@widget_pool || {}).deep_dup.tap do |filtered|
+ filtered.each do |k, values|
+ if values.kind_of?(Hash)
+ values.delete_if {|k, v| !(v.respond_to?(:first) && ["string", "enum", "stringlist", "text", "html", "multienum"].include?(v.first)) }
+ end
+ end
+ end.as_json
end
def name_and_parent_path_from_path(path)
components = path.split('/')
name = components.pop.presence