I'm using Views module to create a block for Gmap to show user location.
Assume that the block is finished and I want to change its parameters.
If I click to the "Setting" of the "Gmap" format, then click "Apply", the data structure will change, from

Array
(
    [0] => stdClass Object
        (
            [location_latitude] => 14.213268
            [location_longitude] => 121.006348
            [users_name] => admin
            [uid] => 1
            [users_created] => 1328843683
            [gmap_lat] => 14.213268
            [gmap_lon] => 121.006348
        )

)

to

Array
(
    [] => Array
        (
            [group] => 
            [rows] => Array
                (
                    [0] => stdClass Object
                        (
                            [location_latitude] => 14.213268
                            [location_longitude] => 121.006348
                            [users_name] => admin
                            [uid] => 1
                            [users_created] => 1328843683
                            [gmap_lat] => 14.213268
                            [gmap_lon] => 121.006348
                        )

                )

        )

)

(the $records variable), leading to this error

Trying to get property of non-object
Notice: Trying to get property of non-object in gmap_plugin_style_gmap->render

Comments

hongquan’s picture

StatusFileSize
new3.38 KB

Here is my patch, for workaround (it just reshapes the distorted data structure, not prevent the distortion).

hongquan’s picture

StatusFileSize
new3.37 KB

Improved patch

mstef’s picture

Patch was made to apply with p3 - should be 0 or 1.

Also, 6 out of 7 fails for the latest dev.

I'm getting the same error that you're getting though.