lib/fiona7/widget_resolver.rb in infopark_fiona7-1.5.5.5.0 vs lib/fiona7/widget_resolver.rb in infopark_fiona7-1.5.5.5.1

- old
+ new

@@ -27,20 +27,27 @@ self.id_map = widget_id_to_object_id_map.dup self.path_map = Hash[ widget_id_to_object_id_map.map {|widget_id, obj_id| path = object_id_to_widget_instance_map[obj_id].try(:path) + # NOTE: with garbage collection some widget objects may become + # invisible: that is they are still in the database, but unreadable + # when querying for released contents (because reverted for example) + # This results in a "dead" link in the widget pool, but shouldn't + # therwise be harmful next unless path [widget_id, object_id_to_widget_instance_map[obj_id].try(:path)] }.compact ] self.instance_map = Hash[ widget_id_to_object_id_map.map {|widget_id, obj_id| object = object_id_to_widget_instance_map[obj_id] - if !object - Rails.logger.error("Unable to find widget with id #{widget_id} (obj_id = #{obj_id})") - next - end + # NOTE: with garbage collection some widget objects may become + # invisible: that is they are still in the database, but unreadable + # when querying for released contents (because reverted for example) + # This results in a "dead" link in the widget pool, but shouldn't + # therwise be harmful + next unless object [widget_id, object] }.compact ] end end