Hello,
I have set a search api solr view for searching in the map and I am using leaflet_views_plugin_style to format results. Everything seems ok, but since I am adding just indexed fields, this notice will throw:
"Notice: Undefined property: leaflet_views_plugin_style::$entity_type in leaflet_views_plugin_style->render() (line 274 of /home/mysite/public_html/sites/all/modules/contrib/leaflet/leaflet_views/leaflet_views_plugin_style.inc)."
I'm been looking at the above file, and I realized that I only had fields and no $this->entity_type variable is set at that point, so calling:
leaflet_apply_map_settings($map, $data, $this->options, $this->entity_type)
will throw the above mentioned notice.
I've changed this function, passing NULL if no entity_type is configured, but this will bring another problem when tokenizen the icons and popups in leaflet_apply_map_settings function.
So I've added a patch, that solve both, but I don't know if it is the good way or I am missing something, so any feedback will be great.
This issue was posted here #1829580: Support Search API and others!, but I think create a new issue is better, since the other one was Fixed and closed.
Comment | File | Size | Author |
---|---|---|---|
notice-views-plugin-when-no-entity-type-exists.patch | 2.73 KB | TuWebO |
Comments
Comment #1
Amber Himes MatzEffectively removes the notice for me. Applied to 7.x-1.1.
Comment #2
Amber Himes MatzComment #3
Dean Clayton CreditAttribution: Dean Clayton commentedpatch worked for me as well, any chance of getting this being applied?
Comment #4
TuWebO CreditAttribution: TuWebO commentedHi,
Looks like another patch has been posted in this issue #2466365: [leaflet views] entity type not detected for search_api views. It looks like it is a more elegant and better solution than this one. I have already tried that one and it is working fine for me.
Could you guys take a look at that one instead?
I will close this one as duplicate, feel free to reopen it if the other one does not work for you.