1) I've found two syntax errors on latest dev version:

PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/smart.drautadev.com/httpdocs/sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_style.inc on line 679, referer: http://smart.drautadev.com/admin/structure/views/ 
PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/smart.drautadev.com/httpdocs/sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_style.inc on line 716, referer: http://smart.drautadev.com/admin/structure/views/

You have an instruction like this:

if ($aggregation_field) {
  $location->aggregation_value = ip_geoloc_get_view_result($views_plugin_style, $aggregation_field, $i)[0];
}

Should be splitted into two:

if ($aggregation_field) {
  $view_result = ip_geoloc_get_view_result($views_plugin_style, $aggregation_field, $i);
  $location->aggregation_value = $view_result[0];
}

2) Also, If I enable and configure Cluster aggregation this error shows up:

PHP Fatal error: Call to a member function get_value() on a non-object in sites/all/modules/contrib/views/plugins/views_plugin_style.inc on line 565

Final note: I'm running PHP 5.3.

Comments

rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
rcodina’s picture

StatusFileSize
new1.33 KB

The patch I enclose only fixes first error.

rdeboer’s picture

Ouch!
Thanks for this -- that's the price you pay for being at the bleeding edge, Roger! :-)

"Final note: I'm running PHP 5.3"... Ah, yes... I'm running PHP 5.4... So that explains the first error.

I will be investigating the 2nd error. Maybe don't configure the "Cluster Aggregation" then, for now.

Rik

rcodina’s picture

Thanks Rik,

One more thing. we found out that marker differentiator may be broken too. Could you please check it?

Thanks!

rdeboer’s picture

In what way is the differentiator broken?
What kind of error do you get?
Rik

rcodina’s picture

All markers get same color (I get this error using all latest dev version of all leaflet modules and latest dev module of this one)

rcodina’s picture

Hi Rik,

Forget about the marker differentiator. It works like a charm. It was my fault on views configuration.

Thanks!

rcodina’s picture

Status: Active » Needs review
StatusFileSize
new2.51 KB

Both errors solved. The second error was due to selecting a non numeric field. So we must avoid the user to select that fields:

a) I first tried this approach (best option):

form_error($form['cluster_aggregation']['aggregation_field'], t('The aggregation field must be numeric.'));

But after first validation error on that field, ajax breaks:

PHP Fatal error: Call to a member function options_validate() on a non-object in /var/www/vhosts/dev.eu-smartcities.eu/httpdocs/sites/all/modules/contrib/views/includes/admin.inc on line 3301, referer: http://dev.eu-smartcities.eu/admin/structure/views/view/map_home_leaflet_search/edit

b) So I finally did this:

drupal_set_message(t('Setting aggregation fields which are not numeric causes blank screens.'), 'warning');

  • RdeBoer committed 26ae8ee on 7.x-1.x authored by rcodina
    Validation on cluster aggregation field to be numeric [#2355555]. Thanks...

Status: Needs review » Needs work

The last submitted patch, 11: errors_on_latest_dev-2355555-11.patch, failed testing.

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Needs work » Fixed

The patch I checked in, is slightly different from the original and seems to work fine. It issues a warning rather than a form error because not every Views field is a Field API field, so it cannot determine with 100% certainty if a selected aggregation field is numeric or not.

rcodina’s picture

Ok Rik, thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.