Hi,
First of all, thanks for really great module!
I recently noticed that GMap module generate some error notice in one particular case.
I've got Better Exposed Filters that filter my GMap by province. After filtering everything shows up, but I've got this error:
Notice: Undefined index: style_plugin w gmap_views_ajax_data_alter() (linia 1378 z /sites/all/modules/gmap/gmap.module).
I don't have a clue what's the problem. Could you help?

Comments

grozozo’s picture

Thx for this great module!

I get the same message since I added a contextual filters for current node ID in my Gmap view.
Everything is working but this message keeps showing up, 2 times per node from the only content type that contain locations and use gmap.

Notice: Undefined index: style_plugin en gmap_views_ajax_data_alter() (línea 1367 de /sites/all/modules/gmap/gmap.module).

pixelula’s picture

Version: 7.x-2.3-alpha2 » 7.x-2.3
Status: Active » Needs review
StatusFileSize
new721 bytes

Hi, this patch work for me. I just added a index validation.

Status: Needs review » Needs work

The last submitted patch, gmap-undefined-style-plugin-1890460-1782709.patch, failed testing.

mist’s picture

Works for me thx :-)

Btw.

  if (! (in_array ('gmap', $plugin_styles) || in_array ('gmap', $plugin_styles)))
    return;

in my opinion should look like
if (! (in_array ('gmap', $plugin_styles))) retrun ;

podarok’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Issue tags: +Needs tests

looks like test bot unhappy (

this needs updating tests

johnv’s picture

@podarok, seems there is a general error in the tests. Below error also appears in #1926360:
PHP Fatal error: Call to undefined function gmap_todim() in /var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/gmap/tests/gmap.test on line 22

podarok’s picture

#6
yes - tests for gmap module a old and with deprecated functions in it
we need update em for successfull "need review" process

possibly in follow-up

podarok’s picture

Status: Needs work » Needs review
podarok’s picture

Status: Needs review » Needs work

testbot happy
looks like #4 reasonable for me

can You update a patch with it?

johnv’s picture

Title: Undefined index: style_plugin in gmap_views_ajax_data_alter() (linia 1378 z /sites/all/modules/gmap/gmap.module). » Undefined index: style_plugin in gmap_views_ajax_data_alter() of gmap.module
Status: Needs work » Needs review
StatusFileSize
new866 bytes

Fresh patch including #3 and #4 and code styling.
These kind of patches seem more like symptom-busting then root cause analysis, but "a'-la"

podarok’s picture

Status: Needs review » Needs work

good to see tests here for page generating Notice( /tests/gmap.test )

helmo’s picture

Status: Needs work » Needs review
StatusFileSize
new607 bytes

A quick re-roll of the patch in #10

@podarok: What would you like to test for? This issue seems clear enough.

podarok’s picture

2 #12
Good to see here a test reproducing notice

podarok’s picture

podarok’s picture

Category: bug » task

#12 commited pushed to 7.x-2.x
thanks

podarok’s picture

Assigned: Unassigned » podarok
Status: Needs review » Needs work

status for tests