Blacklight-maps Document View Error

29 views
Skip to first unread message

Amgad Alsisi

unread,
Dec 14, 2020, 5:21:30 AM12/14/20
to Blacklight Development
Hello ,

I'm new comer to blacklight-maps. I have installed it and run it successfully except when I try to view a document. It gives  Action Controller: Exception caught "NoMethodError in Catalog#show"

---------------------------------------------------------------------------------------------------------------  
Showing /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-maps-1.1.0/app/views/catalog/_show_maplet_default.html.erb where line #7 raised:

undefined method `uniq' for "33.32027338009448,44.30440466526143":String
Extracted source (around line #88):

      
86 return unless coordinates_field_values
87  
88 coordinates_field_values.uniq.each do |coords|
89 @features << build_feature_from_coords(coords)
90 end
91 end

Trace of template inclusion: /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/_show_main_content.html.erb, /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/show.html.erb

Rails.root: /home/solr/blacklight-maps

---------------------------------------------------------------------------------------------------------------
I'm using point coordinates only (no geojson).

How can I fix this issue.

thanks,
Amgad

here is the affected portion of the log:-

Started GET "/catalog/bcb746f9-1adc-44e9-b5e8-3d2d6926fb58" for 192.168.17.7 at 2020-12-14 11:49:58 +0200
Cannot render console from 192.168.17.7! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by CatalogController#show as HTML
  Parameters: {"id"=>"bcb746f9-1adc-44e9-b5e8-3d2d6926fb58"}
Solr query: get get {:qt=>nil, :ids=>"bcb746f9-1adc-44e9-b5e8-3d2d6926fb58"}
Solr fetch (6.8ms)
  [1m [36mSearch Load (0.2ms) [0m  [1m [34mSELECT  "searches".* FROM "searches" WHERE "searches"."id" = ? AND "searches"."id" = ? ORDER BY updated_at desc LIMIT ? [0m  [["id", 37], ["id", 37], ["LIMIT", 1]]
  ↳ /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/log_subscriber.rb:98
Solr query: get select {"qt"=>nil, "facet.field"=>["Project_Location", "coordinates", "Competitor_Names", "{!ex=Inquiry_Year_single}Inquiry_Year", "Plant_Type_Names", "Country_Name", "Area_Name", "Client_Name", "Project_name"], "facet.query"=>[], "facet.pivot"=>[], "fq"=>["{!geofilt sfield=coordinates}"], "hl.fl"=>[], "rows"=>2, "facet"=>false, "f.Project_Location.facet.limit"=>-2, "f.coordinates.facet.limit"=>-2, "f.Plant_Type_Names.facet.limit"=>6, "f.Country_Name.facet.limit"=>11, "sort"=>"score desc, Inquiry_date desc, Project_name asc", "pt"=>"33.32027338009448,44.30440466526143", "d"=>0.5, "fl"=>"id"}
Solr fetch (6.6ms)
  Rendering /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/show.html.erb within layouts/catalog_result
  Rendered /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/_start_over.html.erb (1.2ms)
  Rendered /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/_previous_next_doc.html.erb (1.0ms)
Looking for document partial show_header_list_default
Looking for document partial show_header_list_default
Looking for document partial show_header_default
Looking for document partial show_header_default
Looking for document partial show_header
Looking for document partial show_list_default
Looking for document partial show_list_default
Looking for document partial show_default
Looking for document partial show_default
Looking for document partial show
Looking for document partial show_maplet_list_default
Looking for document partial show_maplet_list_default
Looking for document partial show_maplet_default
  Rendered /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/_show_main_content.html.erb (57.0ms)
  Rendered /home/solr/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/blacklight-7.13.2/app/views/catalog/show.html.erb within layouts/catalog_result (60.9ms)
Completed 500 Internal Server Error in 81ms (ActiveRecord: 0.2ms)


  
ActionView::Template::Error (undefined method `uniq' for "33.32027338009448,44.30440466526143":String):
    4:     <%= blacklight_map_tag('blacklight-show-map',
    5:                            {data:{initialzoom:blacklight_config.view.maps.show_initial_zoom,
    6:                                   singlemarkermode:false}}) %>
    7:     <%= javascript_tag "$('#blacklight-show-map').blacklight_leaflet_map(#{serialize_geojson(@document)});" %>
    8:   </div>
    9: <% end %>
  
blacklight-maps (1.1.0) lib/blacklight/maps/export.rb:88:in `build_features_from_coords'
blacklight-maps (1.1.0) lib/blacklight/maps/export.rb:73:in `build_show_features'
blacklight-maps (1.1.0) lib/blacklight/maps/export.rb:49:in `build_geojson_features'
blacklight-maps (1.1.0) lib/blacklight/maps/export.rb:28:in `to_geojson'
blacklight-maps (1.1.0) app/helpers/blacklight/blacklight_maps_helper_behavior.rb:93:in `serialize_geojson'
blacklight-maps (1.1.0) app/views/catalog/_show_maplet_default.html.erb:7:in `__home_solr__rbenv_versions_______lib_ruby_gems_______gems_blacklight_maps_______app_views_catalog__show_maplet_default_html_erb__3022414817396789216_70165757867760'
actionview (5.2.4.4) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.4.4) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.4.4) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.4.4) lib/action_view/template.rb:157:in `render'
blacklight (7.13.2) app/helpers/blacklight/render_partials_helper_behavior.rb:67:in `render_document_partial'
blacklight (7.13.2) app/helpers/blacklight/render_partials_helper_behavior.rb:31:in `block in render_document_partials'
blacklight (7.13.2) app/helpers/blacklight/render_partials_helper_behavior.rb:30:in `map'
blacklight (7.13.2) app/helpers/blacklight/render_partials_helper_behavior.rb:30:in `render_document_partials'
blacklight (7.13.2) app/views/catalog/_show_main_content.html.erb:22:in `block (2 levels) in __home_solr__rbenv_versions_______lib_ruby_gems_______gems_blacklight________app_views_catalog__show_main_content_html_erb__2281191545243532622_70165639334540'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:41:in `block in capture'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:205:in `with_output_buffer'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:41:in `capture'
view_component (2.22.1) lib/view_component/base.rb:145:in `with'
blacklight (7.13.2) app/views/catalog/_show_main_content.html.erb:20:in `block in __home_solr__rbenv_versions_______lib_ruby_gems_______gems_blacklight________app_views_catalog__show_main_content_html_erb__2281191545243532622_70165639334540'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:41:in `block in capture'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:205:in `with_output_buffer'
actionview (5.2.4.4) lib/action_view/helpers/capture_helper.rb:41:in `capture'
view_component (2.22.1) lib/view_component/base.rb:75:in `render_in'
view_component (2.22.1) lib/view_component/render_monkey_patch.rb:7:in `render'
blacklight (7.13.2) app/views/catalog/_show_main_content.html.erb:6:in `__home_solr__rbenv_versions_______lib_ruby_gems_______gems_blacklight________app_views_catalog__show_main_content_html_erb__2281191545243532622_70165639334540'
actionview (5.2.4.4) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.4.4) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.4.4) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.4.4) lib/action_view/template.rb:157:in `render'
actionview (5.2.4.4) lib/action_view/renderer/partial_renderer.rb:344:in `block in render_partial'
actionview (5.2.4.4) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.4.4) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.4.4) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.4.4) lib/action_view/renderer/partial_renderer.rb:333:in `render_partial'
actionview (5.2.4.4) lib/action_view/renderer/partial_renderer.rb:312:in `render'
actionview (5.2.4.4) lib/action_view/renderer/renderer.rb:49:in `render_partial'
actionview (5.2.4.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.2.4.4) lib/action_view/helpers/rendering_helper.rb:33:in `render'
view_component (2.22.1) lib/view_component/render_monkey_patch.rb:9:in `render'
blacklight (7.13.2) app/helpers/blacklight/catalog_helper_behavior.rb:179:in `render_document_main_content_partial'
blacklight (7.13.2) app/views/catalog/show.html.erb:8:in `__home_solr__rbenv_versions_______lib_ruby_gems_______gems_blacklight________app_views_catalog_show_html_erb__2928253623935743373_70165605759000'
actionview (5.2.4.4) lib/action_view/template.rb:159:in `block in render'
activesupport (5.2.4.4) lib/active_support/notifications.rb:170:in `instrument'
actionview (5.2.4.4) lib/action_view/template.rb:354:in `instrument_render_template'
actionview (5.2.4.4) lib/action_view/template.rb:157:in `render'
actionview (5.2.4.4) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (5.2.4.4) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.4.4) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.2.4.4) lib/action_view/renderer/abstract_renderer.rb:43:in `instrument'
actionview (5.2.4.4) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (5.2.4.4) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (5.2.4.4) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (5.2.4.4) lib/action_view/renderer/template_renderer.rb:16:in `render'
actionview (5.2.4.4) lib/action_view/renderer/renderer.rb:44:in `render_template'
actionview (5.2.4.4) lib/action_view/renderer/renderer.rb:25:in `render'
actionview (5.2.4.4) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.2.4.4) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionview (5.2.4.4) lib/action_view/rendering.rb:84:in `render_to_body'
actionpack (5.2.4.4) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.2.4.4) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (5.2.4.4) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (5.2.4.4) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
activesupport (5.2.4.4) lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
/home/solr/.rbenv/versions/2.6.1/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
activesupport (5.2.4.4) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.2.4.4) lib/active_record/railties/controller_runtime.rb:31:in `cleanup_view_runtime'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:45:in `render'
view_component (2.22.1) lib/view_component/rendering_monkey_patch.rb:9:in `render'
actionpack (5.2.4.4) lib/action_controller/metal/implicit_render.rb:35:in `default_render'
actionpack (5.2.4.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
actionpack (5.2.4.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
actionpack (5.2.4.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (5.2.4.4) lib/abstract_controller/base.rb:194:in `process_action'
actionpack (5.2.4.4) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.2.4.4) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (5.2.4.4) lib/active_support/callbacks.rb:132:in `run_callbacks'
actionpack (5.2.4.4) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (5.2.4.4) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `block in instrument'
activesupport (5.2.4.4) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
activesupport (5.2.4.4) lib/active_support/notifications.rb:168:in `instrument'
actionpack (5.2.4.4) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (5.2.4.4) lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
activerecord (5.2.4.4) lib/active_record/railties/controller_runtime.rb:24:in `process_action'
actionpack (5.2.4.4) lib/abstract_controller/base.rb:134:in `process'
actionview (5.2.4.4) lib/action_view/rendering.rb:32:in `process'
actionpack (5.2.4.4) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (5.2.4.4) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (5.2.4.4) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
actionpack (5.2.4.4) lib/action_dispatch/routing/route_set.rb:34:in `serve'
actionpack (5.2.4.4) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.4.4) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.4.4) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.4.4) lib/action_dispatch/routing/route_set.rb:840:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (5.2.4.4) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.4.4) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.4.4) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.4.4) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:22:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.4.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.4.4) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.4.4) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.4.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.4.4) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
railties (5.2.4.4) lib/rails/engine.rb:524:in `call'
puma (3.12.6) lib/puma/configuration.rb:227:in `call'
puma (3.12.6) lib/puma/server.rb:706:in `handle_request'
puma (3.12.6) lib/puma/server.rb:476:in `process_client'
puma (3.12.6) lib/puma/server.rb:334:in `block in run'
puma (3.12.6) lib/puma/thread_pool.rb:135:in `block in spawn_thread'
 

Blacklight-maps-1.jpg
Blacklight-maps-4.jpg
Blacklight-maps-3.jpg
Blacklight-maps-2.jpg

Justin Coyne

unread,
Dec 14, 2020, 10:16:07 AM12/14/20
to blacklight-...@googlegroups.com
Hello Amgad,

I don't use blacklight-maps, but it looks like it's expecting an Array (which has the 'uniq' method) and instead it's getting a string that contains two numbers separated by a comma. Have you verified that the data is indexed as expected?

-Justin

-

--
You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blacklight-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blacklight-development/d5229a85-a422-4d78-93bc-2394a8a57d48n%40googlegroups.com.

Amgad Alsisi

unread,
Dec 14, 2020, 10:55:00 AM12/14/20
to Blacklight Development
Hello,
Thank you for your prompt response, I'm following the guidelines giving in the README.md where we copy the coordinates into a multivalued string. We use both the coordinates and this string into different fields in the catalog_controller.rb config part. This setup have worked in the face and map screens but not in this instance, where we are getting this error. I guess that there is a missing config or a bug in the code, but I would not be able to change the code to pass an array instead of the string.

Amgad


You received this message because you are subscribed to a topic in the Google Groups "Blacklight Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blacklight-development/7lJLA2WpBzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blacklight-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blacklight-development/CAGnAKfO4tgqGvS8wEVOCgE81ngzpFT2VMMbvjhAQaB5R5t5L9A%40mail.gmail.com.

Amgad Alsisi

unread,
Dec 17, 2020, 3:36:02 AM12/17/20
to Blacklight Development
Hello,

Just to help any one else who may face this issue in the future, I have managed to overcome this error by using the geojson instead of the point coordinates in the Solr index definitions and the blacklight controllers configurations.

Amgad

Reply all
Reply to author
Forward
0 new messages